C Simple Logging Management

494 views Asked by At

I'm currently using the not so sophisticated printf method of logging; and I'm wondering whether to use something like "log4c" "zlog" or "syslog" to better manage ongoing debug/informational output. I'm not asking for a "best" library for the task; but for help on choosing when the added complexity and dependency of a logging library is outweighed by the neatness and organization provided. What level of complexity of a project merits a special purpose library?

1

There are 1 answers

0
user3629249 On

When debugging, use fprintf(stderr, .... );

When logging for long term use, suggest syslog() because:

  1. the syslog contents are automatically archived each day.
  2. the syslog is where most users go to help trace project activity.
  3. the syslog records are date/time stamped.
  4. syslog is very flexible on the data contents portion of the records.