Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一定要用close吗? #11

Open
ugenehan opened this issue Nov 29, 2016 · 4 comments
Open

一定要用close吗? #11

ugenehan opened this issue Nov 29, 2016 · 4 comments

Comments

@ugenehan
Copy link

在无限循环里面如何输出到文件?必须用close吗?使用文档不太好。

@hjweddie
Copy link
Member

  1. 需要输出到文件可以参考下examples。file writer use config file
  2. 在无限循环里面调用log.Info 等各级别日志函数就可以输出到文件里面了
  3. 强烈建议在程序结束前调用Close方法.
  4. 请问使用文档觉得需要补充什么呢?

@ugenehan
Copy link
Author

谢谢,前面几个问题都解决了。
文档例如各个API、config的项含义等。
例如这个循环:
for {
log.Debug("Debug")
log.Trace("Trace")
log.Info("Info")
log.Warn("Warn")
log.Error("Error")
log.Critical("Critical")
}
配置文件用的是example中的,这个只有error写到了文件中,其他都没有写到文件中,因此要排查的话只能从源代码中排查,如果有API接口解释,config字段说明就方便多了。
可以看一下这个哥们的,他的说明文档就比较全https://github.com/antlinker/alog

@ugenehan
Copy link
Author

ugenehan commented Dec 1, 2016 via email

@yale8848
Copy link

yale8848 commented Nov 8, 2017

我这边测试rotateSize也不起作用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants