(chore): document and test new LogLevel APIs
Golang lint / lint (push) Successful in 47s

- add godoc for SameLevel and Equal
- update package docs and READMEs with new helpers
- refresh unreleased release notes
- add tests for Printf, HTTP method levels, and level constructors
This commit is contained in:
2026-04-27 17:04:41 +03:00
parent 812caed471
commit b7fa3f7606
6 changed files with 197 additions and 2 deletions
+8
View File
@@ -17,6 +17,11 @@
// passed to writers. Call SetFormatter on a writer to customize timestamps,
// traceback fields, colors, and message layout.
//
// The package also provides helper constructors for common severities such as
// NewInfoLogLevel and NewErrorLogLevel, plus predefined HTTP method-specific
// levels such as HTTPGetLevel and HTTPPostLevel. Use LogLevelForMethod to map
// an HTTP method to one of those predefined levels.
//
// Basic usage:
//
// logger := sneklog.CreateLogger().
@@ -41,4 +46,7 @@
// the logger and are closed by Logger.Close. Writers created from existing
// io.Writer values through CreateTextWriter or CreateJsonWriter remain owned by
// the caller and are not closed by the logger.
//
// LogLevel values can be compared with SameLevel when only severity matters or
// with Equal when the full level configuration must match.
package sneklog