Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在使用不太复杂printf的日志记录方法;我想知道是否使用“ log4c”“ zlog”或“ syslog”之类的东西来更好地管理正在进行的调试/信息输出。我不是要求一个“最好的”库来完成这项任务。但是对于选择日志库增加的复杂性和依赖性何时被提供的整洁和组织所抵消的帮助。什么程度的项目复杂性值得一个特殊用途的库?
printf
log4c
zlog
syslog
调试时,使用fprintf(stderr, .... );
fprintf(stderr, .... );
当记录长期使用时,建议使用 syslog() 因为: