log: Add a new log target to a file descriptor

This patch enables logging of text debug messages (pa_log feature) into a file or a device driver.
Example : pulseaudio --log-target=file:./mylog.txt

(Minor tweaks by Colin + Arun)
This commit is contained in:
Vincent Becker 2011-03-18 11:23:46 +01:00 committed by Colin Guthrie
parent 26366664c1
commit f7acd4bdab
4 changed files with 56 additions and 2 deletions

View file

@ -36,6 +36,7 @@ typedef enum pa_log_target {
PA_LOG_STDERR, /* default */
PA_LOG_SYSLOG,
PA_LOG_NULL, /* to /dev/null */
PA_LOG_FD, /* to a file descriptor, e.g. a char device */
PA_LOG_TARGET_MAX
} pa_log_target_t;
@ -74,6 +75,10 @@ void pa_log_set_level(pa_log_level_t l);
/* Set flags */
void pa_log_set_flags(pa_log_flags_t flags, pa_log_merge_t merge);
/* Set the file descriptor of the logging device.
Daemon conf is in charge of opening this device */
void pa_log_set_fd(int fd);
/* Enable backtrace */
void pa_log_set_show_backtrace(unsigned nlevels);