package
0.1.38
Repository: https://github.com/chroblert/jgoutils.git
Documentation: pkg.go.dev

# README

install

go get -u github.com/chroblert/jgoutils/jlog

Use

直接使用

打印日志有如下方法: jlog.Debug() jlog.Debugf() jlog.Info() jlog.Infof() jlog.Warn() jlog.Warnf() jlog.Error() jlog.Errorf() jlog.Fatal() jlog.Fatalf() 设置日志: jlog.SetLogFullPath("logs/app.log"): 设置文件路径 jlog.SetLogCount(5): 设置日志文件保存的数量 jlog.SetLogLevel(0): 设置日志等级(低于该等级的日志不输出) jlog.SetUseConsole(true): 设置是否在控制台打印日志 jlog2.Flush(): 写入文件 // 主程序结束前调用

新建实例使用

jlog2 := jlog.NewLogger(jlog.LogConfig{ BufferSize: 2048, FlushInterval: 10*time.Second, MaxStoreDays: 5, MaxSizePerLogFile: 204800000, LogCount: 5, LogFullPath: "logs/app2.log", Lv: jlog.DEBUG, UseConsole: true, })

# Functions

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
No description provided by the author
新建一个jlog示例 若不传入LogConfig,则使用默认的只进行创建。每十秒将日志写入文件,不限制存储天数和文件个数,单日志文件大小500MB,在控制台显示,每次运行不新建日志文件 否则,根据传入的LogConfig创建jlog示例.
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
-------- 实例 fishLogger.
设置实例等级.
设置日志文件保存数量.
设置文件保存路径.
No description provided by the author
设置最大保存天数 小于0不删除.
设置是否保存到文件.
设置控制台输出.
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

# Structs

定义FishLogger结构体.
No description provided by the author