Add logging functions with selectable log output targets
authorSteven Luo <steven+maemo@steven676.net>
Sun, 21 Feb 2010 02:13:28 +0000 (18:13 -0800)
committerSteven Luo <steven+maemo@steven676.net>
Sun, 21 Feb 2010 02:13:28 +0000 (18:13 -0800)
Currently, our "logging" consists of a mix of printf(), perror(), and
other such calls which print output to stdout/stderr.  In normal usage,
browser-switchboard will be launched by D-Bus, which results in
stdout/stderr pointing to /dev/null and debugging output being lost.

To improve this situation, introduce a new set of logging functions
log_out() and log_perror(), and a log_config() which allows choosing the
log target.  These functions log to stdout by default, but also support
syslog output (to the LOG_USER facility, with priority LOG_DEBUG) and
disabling logging entirely.

Thanks to Faheem Pervez (qwerty12) for the suggestion.


No differences found