Skip to content

Commit

Permalink
logging: enable syslog by default
Browse files Browse the repository at this point in the history
also inject log_debug into syslog if configured

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Mar 22, 2011
1 parent fe3c236 commit 0e3c5a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion utils.c
Expand Up @@ -6,7 +6,7 @@
#include "utils.h"

int utils_debug = 0;
int utils_syslog = 0;
int utils_syslog = 1;

int knet_fdset_cloexec(int fd)
{
Expand Down
10 changes: 6 additions & 4 deletions utils.h
Expand Up @@ -16,10 +16,12 @@ extern int utils_syslog;
#endif

#define log_debug(fmt, args...) \
if (utils_debug) { \
printf("DEBUG(%s:%i|%s): " fmt "\n", \
__FILE__, __LINE__, __FUNCTION__, ##args); \
}
do { \
if (utils_debug) { \
printf("DEBUG(%s:%i|%s): " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##args); \
if (utils_syslog) syslog(LOG_DEBUG, "DEBUG(%s:%i|%s): " fmt, __FILE__, __LINE__, __FUNCTION__, ##args); \
} \
} while (0);

#define log_info(fmt, args...) \
do { \
Expand Down

0 comments on commit 0e3c5a9

Please sign in to comment.