@@ -13,7 +13,7 @@ This document is maintained by Jonathan Amsterdam `
[email protected] `.
13
13
14
14
The standard library’s ` log/slog ` package has a two-part design.
15
15
A "frontend," implemented by the ` Logger ` type,
16
- gathers stuctured log information like a message, level, and attributes,
16
+ gathers structured log information like a message, level, and attributes,
17
17
and passes them to a "backend," an implementation of the ` Handler ` interface.
18
18
The package comes with two built-in handlers that usually should be adequate.
19
19
But you may need to write your own handler, and that is not always straightforward.
@@ -76,7 +76,7 @@ A logger's `WithGroup` method calls its handler's `WithGroup` method.
76
76
77
77
We can now talk about the four ` Handler ` methods in detail.
78
78
Along the way, we will write a handler that formats logs using a format
79
- reminsicent of YAML. It will display this log output call:
79
+ reminiscent of YAML. It will display this log output call:
80
80
81
81
logger.Info("hello", "key", 23)
82
82
@@ -100,7 +100,7 @@ and the `New` function that constructs it from an `io.Writer` and options:
100
100
%include indenthandler1/indent_handler.go types -
101
101
102
102
We'll support only one option, the ability to set a minimum level in order to
103
- supress detailed log output.
103
+ suppress detailed log output.
104
104
Handlers should always declare this option to be a ` slog.Leveler ` .
105
105
The ` slog.Leveler ` interface is implemented by both ` Level ` and ` LevelVar ` .
106
106
A ` Level ` value is easy for the user to provide,
@@ -557,7 +557,7 @@ Beware of facile claims like "Unix writes are atomic"; the situation is a lot mo
557
557
Some handlers have legitimate reasons for keeping state.
558
558
For example, a handler might support a ` SetLevel ` method to change its configured level
559
559
dynamically.
560
- Or it might output the time between sucessive calls to ` Handle ` ,
560
+ Or it might output the time between successive calls to ` Handle ` ,
561
561
which requires a mutable field holding the last output time.
562
562
Synchronize all accesses to such fields, both reads and writes.
563
563
0 commit comments