1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
package main
import (
"github.com/evilsocket/islazy/log"
)
func main() {
// equivalent to log.Output = ""
log.Output = "/dev/stdout"
log.Level = log.DEBUG
log.OnFatal = log.NoneOnFatal
log.DateFormat = "06-Jan-02"
log.TimeFormat = "15:04:05"
log.DateTimeFormat = "2006-01-02 15:04:05"
log.Format = "{datetime} {level:color}{level:name}{reset} {message}"
log.Callback = func(verbosity log.Verbosity, message string) {
// fmt.Printf("got message '%s'\n", message)
}
if err := log.Open(); err != nil {
panic(err)
}
defer log.Close()
log.Raw("hello world")
log.Debug("hello world")
log.Info("hello world")
log.Important("hello world")
log.Warning("hello world")
log.Error("hello world")
log.Fatal("hello world")
log.OnFatal = log.ExitOnFatal
log.NoEffects = true
log.Raw("hello world")
log.Debug("hello world")
log.Info("hello world")
log.Important("hello world")
log.Warning("hello world")
log.Error("hello world")
log.Fatal("hello world")
}
|