Example is better.
This commit is contained in:
parent
938f9289fa
commit
35ded7bc60
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue