Example is better.

This commit is contained in:
Kyle 2015-09-22 03:32:44 -07:00
parent 938f9289fa
commit 35ded7bc60
1 changed files with 9 additions and 7 deletions

View File

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