日志框架库-Liblogging
2014-02-13 09:49:00 阿炯

本站赞助商链接,请多关照。 Liblogging是一个易用、跨平台的RFC 3195风格的日志框架,使用非常简单的API,支持RAW和COOKED profile。采用C语言开发并在BSD协议下授权。


Liblogging offers an enhanced replacement for the syslog() call, but retains its ease of use.

In a nutshell, it permits sytem administrators to direct application log output to different destinations without requiring the app developer to do any work for this. Liblogging is released under a 2-clause BSD license and as such can be used in any application.

If you dig deeper, liblogging actually has three components, which address different needs.

stdlog
This is the component of interest for most users. It offers the syslog() API replacement. Right now, it actually does more or less what syslog() did. In the future, however, it will support different log destinations, like
 syslog()
 systemd journal native API
 unix domain socket
 files

This will permit an application developer to use a single, very easy to use set of function calls to talk to any logging system. The admin will be able to configure which destination to actually use.

journalemu
This component (not yet committed) emulates the most important logging calls of systemd journal. This permits applications to be written to this spec, even though the journal is not available on all platforms. Of course, we recommend writing directly to stdlog, as this solves the problem more cleanly.

rfc3195
This is liblogging's original component. Back in 2002, we thought that logging would be taken over by rfc3195 and thus we begun working on a library -liblogging- that makes this easy. While the lib is there, rfc3195 has turned out to be a big failure. This component is no longer enhanced, but it is still available for those apps that need it.

最新版本:1.0
该版本中RFC 3195作为一个可选组件,增加了 libstdlog 组件用于标准日志。

官方主页:http://www.liblogging.org/