Documentation ¶
Overview ¶
Package loglvl adds a bit of leveled logging to log.Logger.
Example ¶
var buf bytes.Buffer log := New(0, log.New(&buf, "", log.LstdFlags)) msg0 := "a level 0 message" if log.Level() >= 0 { log.Println(msg0) } msg1 := "a level 1 message" if log.Level() >= 1 { log.Println(msg1) } msgs := string(buf.Bytes()) fmt.Println(strings.Contains(msgs, msg0)) fmt.Println(strings.Contains(msgs, msg1))
Output: true false
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.