Standard library / log/slog
slog.LevelVar
Concurrency-safe mutable severity threshold; zero value represents INFO. Expected stdout: 'ERROR\n'.
Formal Syntax & Structure
go syntaxgo
type LevelVar struct {}Working Example
Example Snippetgo
package main
import ( "fmt" "log/slog")
func main() { var l slog.LevelVar; l.Set(slog.LevelError); fmt.Println(l.Level()) }