使用 syslog 时禁用/启用日志记录
我打算使用 syslog 来登录应用程序。我需要能够在编译时禁用日志记录,也许可以使用宏。这是否可以与系统日志设施有关,或者我是否需要将系统日志包装在我自己的宏/函数中?能够根据优先级禁用/启用日志消息是一个优点。
I intend to use syslog for logging in an application. I need to be able to disable logging, at compile time, perhaps using a macro. Is this possible to do with the syslog facilities, or do I need to wrap syslog in my own macros/functions? The ability to disable/enable log messages based on their priority is a plus.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许您可以将调用包装到 setlogmask 在定义块中。
像这样的东西:
Maybe you could wrap a call to setlogmask in define block.
something like this :