Add logging functions with selectable log output targets
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.