Example is better.
This commit is contained in:
parent
938f9289fa
commit
35ded7bc60
|
@ -1,20 +1,22 @@
|
||||||
package logging
|
package logging_test
|
||||||
|
|
||||||
var log = Init()
|
import "github.com/kisom/goutils/logging"
|
||||||
var olog = New("subsystem #42", LevelNotice)
|
|
||||||
|
var log = logging.Init()
|
||||||
|
var olog = logging.New("subsystem #42", logging.LevelNotice)
|
||||||
|
|
||||||
func Example() {
|
func Example() {
|
||||||
log.Notice("Hello, world.")
|
log.Notice("Hello, world.")
|
||||||
log.Warning("this program is about to end")
|
log.Warning("this program is about to end")
|
||||||
|
|
||||||
olog.Print("now online")
|
olog.Print("now online")
|
||||||
Suppress("olog")
|
logging.Suppress("olog")
|
||||||
olog.Print("extraneous information")
|
olog.Print("extraneous information")
|
||||||
|
|
||||||
Enable("olog")
|
logging.Enable("olog")
|
||||||
olog.Print("relevant now")
|
olog.Print("relevant now")
|
||||||
|
|
||||||
SuppressAll()
|
logging.SuppressAll()
|
||||||
log.Alert("screaming into the void")
|
log.Alert("screaming into the void")
|
||||||
olog.Critical("can anyone hear me?")
|
olog.Critical("can anyone hear me?")
|
||||||
|
|
||||||
|
@ -23,7 +25,7 @@ func Example() {
|
||||||
log.Suppress()
|
log.Suppress()
|
||||||
log.Warning("but not for long")
|
log.Warning("but not for long")
|
||||||
|
|
||||||
EnableAll()
|
logging.EnableAll()
|
||||||
log.Notice("fare thee well")
|
log.Notice("fare thee well")
|
||||||
olog.Print("all good journeys must come to an end")
|
olog.Print("all good journeys must come to an end")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue