Standard library / log/slog

slog.Level.String()

Return the symbolic severity name with an offset for nonstandard levels. Expected stdout: 'INFO\n'.

Formal Syntax & Structure

go syntaxgo
func (l Level) String() string

Return Value

string

Return the symbolic severity name with an offset for nonstandard levels.

Working Example

Example Snippetgo
package main
import (  "fmt"  "log/slog")
func main() { fmt.Println(slog.LevelInfo.String()) }
Go Reference