|author||Seth Vargo <email@example.com>||Tue Jan 17 13:38:31 2023 -0500|
|committer||Jonathan Amsterdam <firstname.lastname@example.org>||Wed Jan 18 13:47:22 2023 +0000|
exp/slog: add example for custom levels and names The recommended way to introduce new `Level` (or rename an existing one) is via `HandlerOptions.ReplaceAttr`. However, this is not immediately intuitive to package users. This introduces an example that adds additional log levels and gives them custom names in a `ReplaceAttr` function. Given the number of users who will want to introduce custom log levels, this feels like a good addition to the library documentation. Change-Id: I175440368fa1d4ce548d9c769ca22fd613151941 Reviewed-on: https://go-review.googlesource.com/c/exp/+/462435 Reviewed-by: Jonathan Amsterdam <email@example.com> Run-TryBot: Ian Lance Taylor <firstname.lastname@example.org> Reviewed-by: Alan Donovan <email@example.com> TryBot-Result: Gopher Robot <firstname.lastname@example.org>
This subrepository holds experimental and deprecated (in the
old directory) packages.
The idea for this subrepository originated as the
pkg/exp directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to
go get these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)