Documentation
¶
Overview ¶
Example ¶
InitLogger("/tmp", false, time.Local)
logger := GetLogger("helloworld")
logger.Infow("hello log", "key", "value")
RotateLog()
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Logger zap.Logger实例 Logger *zap.SugaredLogger )
Functions ¶
func InitLogger ¶
InitLogger 初始化 path 输出路径 debugLevel 是否输出debug信息 location 日志文件名所属时区
Types ¶
type Writer ¶
type Writer struct {
// Filename is the file to write logs to. Backup log files will be retained
// in the same directory. It uses <processname>-lumberjack.log in
// os.TempDir() if empty.
Filename string `json:"filename" yaml:"filename"`
// contains filtered or unexported fields
}
Writer is an io.WriteCloser that writes to the specified filename.
Click to show internal directories.
Click to hide internal directories.