Skip to content

Commit 1917a66

Browse files
authored
Update README.md
1 parent 01c8ba3 commit 1917a66

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,30 @@
1212

1313
Common formatters for [slog](https://pkg.go.dev/golang.org/x/exp/slog) library + helpers for building your own.
1414

15+
**Handlers:**
16+
- [NewFormatterHandler](#NewFormatterHandler): main handler
17+
- [NewFormatterMiddleware](#NewFormatterMiddleware): compatible with `slog-multi` middlewares
18+
19+
**Common formatters:**
20+
- [TimeFormatter](#TimeFormatter): transforms a `time.Time` into a readable string
21+
- [UnixTimestampFormatter](#UnixTimestampFormatter): transforms a `time.Time` into a unix timestamp.
22+
- [TimezoneConverter](#TimezoneConverter): set a `time.Time` to a different timezone
23+
- [ErrorFormatter](#ErrorFormatter): transforms a go error into a readable error
24+
- [HTTPRequestFormatter](#HTTPRequestFormatter-and-HTTPResponseFormatter): transforms a *http.Request into a readable object
25+
- [HTTPResponseFormatter](#HTTPRequestFormatter-and-HTTPResponseFormatter): transforms a *http.Response into a readable object
26+
- [PIIFormatter](#PIIFormatter): hide private Personal Identifiable Information (PII)
27+
- [IPAddressFormatter](#IPAddressFormatter): hide ip address from logs
28+
29+
**Custom formatter:**
30+
- [Format](#Format): pass any attribute into a formatter
31+
- [FormatByKind](#FormatByKind): pass attributes matching `slog.Kind` into a formatter
32+
- [FormatByType](#FormatByType): pass attributes matching generic type into a formatter
33+
- [FormatByKey](#FormatByKey): pass attributes matching key into a formatter
34+
- [FormatByFieldType](#FormatByFieldType): pass attributes matching both key and generic type into a formatter
35+
- [FormatByGroup](#FormatByGroup): pass attributes under a group into a formatter
36+
- [FormatByGroupKey](#FormatByGroupKey): pass attributes under a group and matching key, into a formatter
37+
- [FormatByGroupKeyType](#FormatByGroupKeyType): pass attributes under a group, matching key and matching a generic type, into a formatter
38+
1539
**See also:**
1640

1741
- [slog-multi](https://github.com/samber/slog-multi): `slog.Handler` chaining, fanout, routing, failover, load balancing...
@@ -88,30 +112,6 @@ logger.Error("a message",
88112

89113
GoDoc: [https://pkg.go.dev/github.com/samber/slog-formatter](https://pkg.go.dev/github.com/samber/slog-formatter)
90114

91-
**Handlers:**
92-
- [NewFormatterHandler](#NewFormatterHandler): main handler
93-
- [NewFormatterMiddleware](#NewFormatterMiddleware): compatible with `slog-multi` middlewares
94-
95-
**Common formatters:**
96-
- [TimeFormatter](#TimeFormatter): transforms a `time.Time` into a readable string
97-
- [UnixTimestampFormatter](#UnixTimestampFormatter): transforms a `time.Time` into a unix timestamp.
98-
- [TimezoneConverter](#TimezoneConverter): set a `time.Time` to a different timezone
99-
- [ErrorFormatter](#ErrorFormatter): transforms a go error into a readable error
100-
- [HTTPRequestFormatter](#HTTPRequestFormatter-and-HTTPResponseFormatter): transforms a *http.Request into a readable object
101-
- [HTTPResponseFormatter](#HTTPRequestFormatter-and-HTTPResponseFormatter): transforms a *http.Response into a readable object
102-
- [PIIFormatter](#PIIFormatter): hide private Personal Identifiable Information (PII)
103-
- [IPAddressFormatter](#IPAddressFormatter): hide ip address from logs
104-
105-
**Custom formatter:**
106-
- [Format](#Format): pass any attribute into a formatter
107-
- [FormatByKind](#FormatByKind): pass attributes matching `slog.Kind` into a formatter
108-
- [FormatByType](#FormatByType): pass attributes matching generic type into a formatter
109-
- [FormatByKey](#FormatByKey): pass attributes matching key into a formatter
110-
- [FormatByFieldType](#FormatByFieldType): pass attributes matching both key and generic type into a formatter
111-
- [FormatByGroup](#FormatByGroup): pass attributes under a group into a formatter
112-
- [FormatByGroupKey](#FormatByGroupKey): pass attributes under a group and matching key, into a formatter
113-
- [FormatByGroupKeyType](#FormatByGroupKeyType): pass attributes under a group, matching key and matching a generic type, into a formatter
114-
115115
### NewFormatterHandler
116116

117117
Returns a slog.Handler that applies formatters to.

0 commit comments

Comments
 (0)