i've been working in java long time, , i've been accostumed use log4j library logs. it's wonderful, , i'm moving c i'd find if there similar library logs in language.
so far know of following libraries logging: log4c, sclog4c, syslog, zlog.
log4c
log4c invented log4j c. if you're looking "something log4j" because want "log4j", you're looking for.
links
sclog4c
sclog4c invented simple used features of java.util.logging - simple possible. if you're looking "something log4j" because want small , simple possible, you're looking for.
links
syslog
syslog developed eric allman part of sendmail , has become defacto standard daemon / server logging in posix environments. client-server based, daemon wants logged send log data syslogd listening on udp port 514. if you're looking "something log4j" because want log daemon or server, you're looking for.
links
- http://tools.ietf.org/html/rfc5424
- http://man7.org/linux/man-pages/man3/syslog.3.html
- http://en.wikipedia.org/wiki/syslog
zlog
this 1 invented log4c, - according description - smaller , more flexible @ same time.
links
miscellaneous
power vs. lean
because of different way how c links, thinks , works, not logging framework powerful in general case - unlike in java. if you're going "full-blown desktop applications" , beyond, logging powerful frameworks in java way go. if you're implementing command line tools or similar, bet lean framework better - why want depend on lib2xml sake of logging...
speed
in case speed resp. not wasting cycles matters reason, logging framework uses macros evaluate log level before other arguments evaluated.
the downside cannot call log routine arguments have side-effects. shouldn't use case anyway. astonishing if log statements not ignorable because of containing side-effects.
the upside log statements in such framework add few cycles they're not there - access global, check , conditional branch, skipping rest of log code - 2 instructions, 1 cycle in best case on many of today's cpus.
disclaimer
i author of sclog4c.
Comments
Post a Comment