func ExampleNewMinLogger() { h := log.NewMinFormatter(log.SyncWriter(os.Stdout), log.PrefixOpt("PFX:")) l := log.NewLogger(syslog.LOG_WARNING, h) l.ERROR("fejl") // Output: // <3>PFX:fejl }
func ExampleApplyHandlerOptions() { h := log.NewMinFormatter(log.SyncWriter(os.Stdout), log.PrefixOpt("PFX:")) l := log.GetLogger("mylog") l.SetHandler(h) l.ERROR("fejl") l.ApplyHandlerOptions(log.FlagsOpt(log.Llevel | log.Lname)) l.WARN("advarsel") // Output: // <3>PFX:fejl // <4>PFX: (mylog) advarsel }