文件名称:简单golang日志Golog.zip
文件大小:3KB
文件格式:ZIP
更新时间:2022-08-05 00:02:55
开源项目
Golog 是简单的golang日志,基于golang内置log封装. 特征 实现各种日志 level: DEBUG, INFO, WARN, ERROR 实现各种日志 handlers: ConsoleHander, FileHandler, RotatingHandler 代码实例 // rotating hander, max log files is 4, max file size is 4M rotatingHandler := logger.NewRotatingHandler("./", "test.log", 4, 4*1024*1024) // logger set handlers: console, rotating logger.SetHandlers(logger.Console, rotatingHandler) defer logger.Close() // logger set flags logger.SetFlags(log.Ldate | log.Ltime | log.Lshortfile) // logger set log level logger.SetLevel(logger.INFO) logger.Debug("something", "debug") logger.Info("something") logger.Warn("something") logger.Error("something") 标签:Golog
【文件预览】:
golog-master
----logger()
--------logger.go(7KB)
----example()
--------example.go(630B)
----readme.markdown(879B)