# README
精简的日志
import "github.com/thinkhp/logsim"
example
import (
"github.com/thinkhp/logsim"
"testing"
"time"
)
func TestLog(t *testing.T) {
logsim.SetLevelNotPrint(logsim.InfoLevel) //stdout, stderr is null
logsim.SetLevelRedirect(logsim.TraceLevel, logsim.DebugLevel) //trace file is debug.*log
logsim.SetLevelRedirect(logsim.WarnLevel, logsim.DebugLevel) //level warn file is debug*.log
logsim.SetLogRotateTask(logsim.Day) //stdout and stderr is file;rotate in days
logsim.TraceLog.Println(time.Now().Format(time.RFC3339))
logsim.InfoLog.Println(time.Now().Format(time.RFC3339))
logsim.WarnLog.Println(time.Now().Format(time.RFC3339))
logsim.DebugLog.Println(time.Now().Format(time.RFC3339))
logsim.ErrorLog.Println(time.Now().Format(time.RFC3339))
}
# Functions
定义logger, 传入参数:日志级别, 输出文件,前缀字符串,flag标记.
ls 级别的日志即使调用,也不会输出.
将 src 级别的日志输出到 redirect 级别的日志文件.
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author