package
module
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Jan 9, 2022
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 15
Opens a new window with list of known importers.
README
¶
zdpgo_log
Golang日志框架
一、快速入门
1.1 创建日志并记录
package main
import "github.com/zhangdapeng520/zdpgo_log"
func main() {
log := zdpgo_log.New("zdpgo_log.log")
log.SetDebug(true) // 开启debug模式
log.Info("info...")
log.Warning("warning...")
log.Error("error...")
log.Panic("panic...")
log.SetDebug(false) // 关闭debug模式
log.Info("info 111...")
log.Warning("warning 111...")
log.Error("error 111...")
}
Documentation
¶
核心日志对象
func (l *Log) Error(args ...interface{})
记录error类型的日志
func (l *Log) Info(args ...interface{})
记录info类型的日志
func (l *Log) Panic(args ...interface{})
记录panic类型的日志,会panic出异常
func (log *Log) SetDebug(flag bool)
设置日志的debug模式
func (l *Log) Warning(args ...interface{})
记录warning类型的日志
Source Files
¶
Directories
¶
examples
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.