slog: promote subheadings Remove the "Advanced Topics" heading and promote the subheadings. Change-Id: I0ca5ac9d7ec726cd56072528968c634ab290ce30 Reviewed-on: https://go-review.googlesource.com/c/exp/+/476200 Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com>
diff --git a/slog/doc.go b/slog/doc.go index 7b9133f..3b37eec 100644 --- a/slog/doc.go +++ b/slog/doc.go
@@ -212,9 +212,7 @@ It is recommended to pass a context to an output method if one is available. -# Advanced topics - -Customizing a type's logging behavior. +# Customizing a type's logging behavior If a type implements the [LogValuer] interface, the [Value] returned from its LogValue method is used for logging. You can use this to control how values of the type @@ -226,7 +224,7 @@ method handles these cases carefully, avoiding infinite loops and unbounded recursion. Handler authors and others may wish to use Value.Resolve instead of calling LogValue directly. -Wrapping output methods. +# Wrapping output methods The logger functions use reflection over the call stack to find the file name and line number of the logging call within the application. This can produce @@ -248,7 +246,7 @@ The Infof function in the package-level example called "wrapping" demonstrates how to do this. -Working with Records. +# Working with Records Sometimes a Handler will need to modify a Record before passing it on to another Handler or backend. @@ -262,7 +260,7 @@ or create a new Record with [NewRecord] and build up its Attrs by traversing the old ones with [Record.Attrs]. -Performance considerations. +# Performance considerations If profiling your application demonstrates that logging is taking significant time, the following suggestions may help.