记录“信息”和/或评论?
我编写了一个记录器,它写入本地文本文件。 Logger 根据 App.Config 中的指示符值存储信息,并在该值高于指示符值时开始写入文件。如果指示器为 2,则记录 LogLevels 2、3、4。可能的标志有“信息”、“警告”、“异常”、“系统错误”。
现在我在“信息”级别添加了非常详细的日志记录,但忘记添加注释。当添加评论时,我意识到所有“信息”级别的日志信息也可以作为评论。
问题是:这样可以吗?我现在可以省略评论吗?你会怎么办?日志中的“信息”到底是什么?
I have written a Logger which writes into a local Text file. The Logger stores Information based on an indicator value in the App.Config and begins writing to files if the Value is higher than the indicator value. If the Indicator is 2, LogLevels 2,3,4 are Logged. Possible Flags are "Information", "Warning", "Exception", "Systemerror".
Now i have added pretty detailed Logging in the "Information" Level but forget to add comments. And when adding Comments i realized that all the "Information" Level Logging Info could aswell go as a comment.
The Question is: Is that okay? Can i just leave out Comments now? What would you do? What exactly is an "Information" in a log?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看 log4net 文档,您会发现他们使用这些类型的日志级别:
并将其与您的级别进行比较,我认为您的 Comments 级别类似于 Debug 并且我认为两者之间存在差异这两个水平。
If you take a look into the log4net documentation you can find that they use these kinds of log levels:
And comparing this to your levels i think your Comments level is something like Debug and i think there is a difference between these two levels.