diff --git a/xlog.go b/xlog.go index f39f1d3..333aa3d 100644 --- a/xlog.go +++ b/xlog.go @@ -25,8 +25,8 @@ var levelNames = map[int]string{ DEBUG: "[DBG] ", } -var logLevel int -var logger *log.Logger +var logLevel = DEBUG +var logger = log.New(&LogWriter{}, "", log.Ldate|log.Ltime) type LogWriter struct { } @@ -37,7 +37,6 @@ func (w *LogWriter) Write(buf []byte) (int, error) { } func Init(lvl int) { - logger = log.New(&LogWriter{}, "", log.Ldate|log.Ltime) logLevel = lvl }