Trying this with examples.

This commit is contained in:
Kyle 2015-09-22 03:30:55 -07:00
parent 0750c235b6
commit 938f9289fa
1 changed files with 8 additions and 10 deletions

View File

@ -1,22 +1,20 @@
package main package logging
import "github.com/kisom/goutils/logging" var log = Init()
var olog = New("subsystem #42", LevelNotice)
var log = logging.Init() func Example() {
var olog = logging.New("subsystem #42", logging.LevelNotice)
func main() {
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")
logging.Suppress("olog") Suppress("olog")
olog.Print("extraneous information") olog.Print("extraneous information")
logging.Enable("olog") Enable("olog")
olog.Print("relevant now") olog.Print("relevant now")
logging.SuppressAll() 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?")
@ -25,7 +23,7 @@ func main() {
log.Suppress() log.Suppress()
log.Warning("but not for long") log.Warning("but not for long")
logging.EnableAll() 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")
} }