chiark / gitweb /
log to console if syslog is not available
[elogind.git] / logging.h
index 0126de99eb94b2dec6d88896a809272a1f07d6f7..dd520dd874908d39bd6771bc71437b06b65d7778 100644 (file)
--- a/logging.h
+++ b/logging.h
 #undef err
 #define err(format, arg...)                                                    \
        do {                                                                    \
-               log_message(LOG_ERR ,"%s: " format ,__FILE__ ,## arg);          \
+               log_message(LOG_ERR ,"%s: " format ,__FUNCTION__ ,## arg);              \
        } while (0)
 
 #undef info
 #define info(format, arg...)                                                   \
        do {                                                                    \
-               log_message(LOG_INFO ,"%s: " format ,__FILE__ ,## arg);         \
+               log_message(LOG_INFO ,"%s: " format ,__FUNCTION__ ,## arg);             \
        } while (0)
 
 #ifdef DEBUG
@@ -61,7 +61,7 @@ extern void log_message(int priority, const char *format, ...)
 #undef logging_init
 static inline void logging_init(const char *program_name)
 {
-       openlog(program_name, LOG_PID, LOG_DAEMON);
+       openlog(program_name, LOG_PID | LOG_CONS, LOG_DAEMON);
 }
 
 #undef logging_close