### k3log 开箱即用
```
//默认采用key-value, json形式,命令行输出
k3log.Info("name", "k3log")
//2019-02-18T15:11:23.370+0800 INFO main.go:7 {"name": "k3log"}
//开箱即用的NewDevelopment, 日志输入到文件,并实现异步刷新文件
k3log.NewDevelopment("开发模式", "dev.log")
defer k3log.Sync()
k3log.Dump("name", "k3log日志")
//手动配置
k3log.SetLogger(conf.WithLogType("json"), //打印json格式
conf.WithProjectName("k3log日志"), //设置项目名称
conf.WithFilename("k3log.txt"), //设置输出文件名,或输出的路径
conf.WithLogLevel(conf.InfoLevel), //设置日志级别,默认debug
conf.WithMaxAge(30), //日志保存天数,默认30天
conf.WithMaxSize(512), //多少M进行分隔日志,默认100M
conf.WithIsStdOut(false)) //是否同时输出控制台
defer k3log.Sync()
k3log.Error("name", "手动配置")
```
更多见: [https://github.com/ThreeKing2018/k3log](https://github.com/ThreeKing2018/k3log)
有疑问加站长微信联系(非本文作者))