author | mjm <mjm> | 2002-12-27 16:35:28 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-12-27 16:35:28 (UTC) |
commit | 3cb928900ffb1d2799bd7e8e1871aaf8d89b56cf (patch) (side-by-side diff) | |
tree | 180016a8feae9e40c3e6b8be62b518bdf8ef18fc /noncore/net/wellenreiter/libwellenreiter/source/wl_log.cc | |
parent | e6aaae74f39e3aed4dc3c186c56f92cef8c7da09 (diff) | |
download | opie-3cb928900ffb1d2799bd7e8e1871aaf8d89b56cf.zip opie-3cb928900ffb1d2799bd7e8e1871aaf8d89b56cf.tar.gz opie-3cb928900ffb1d2799bd7e8e1871aaf8d89b56cf.tar.bz2 |
cleanup, new protocol, renaming of some functions, GUI has to update!
Diffstat (limited to 'noncore/net/wellenreiter/libwellenreiter/source/wl_log.cc') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/libwellenreiter/source/wl_log.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/libwellenreiter/source/wl_log.cc b/noncore/net/wellenreiter/libwellenreiter/source/wl_log.cc new file mode 100644 index 0000000..7adaba8 --- a/dev/null +++ b/noncore/net/wellenreiter/libwellenreiter/source/wl_log.cc @@ -0,0 +1,51 @@ +/* + * Small functions to log to syslog + * + * $Id$ + */ + +#include "wl_log.hh" + +/* Log to syslog INFO */ +void wl_loginfo(const char *fmt,...) +{ + + char buffer[4096]; + va_list ap; + + memset(buffer, 0, sizeof(buffer)); + va_start(ap, fmt); + vsnprintf(buffer, sizeof(buffer)-1, fmt, ap); + va_end(ap); + + openlog("libwellenreiter", LOG_PID, LOG_SYSLOG); + syslog(LOG_INFO, "(info) %s", buffer); + closelog(); + +#ifdef DEBUG + fprintf(stderr, "(info) %s\n", buffer); +#endif + +} + +/* Log to syslog ERR */ +void wl_logerr(const char *fmt,...) +{ + + char buffer[4096]; + va_list ap; + + memset(buffer, 0, sizeof(buffer)); + va_start(ap, fmt); + vsnprintf(buffer, sizeof(buffer)-1, fmt, ap); + va_end(ap); + + openlog("libwellenreiter", LOG_PID, LOG_SYSLOG); + syslog(LOG_INFO, "(err) %s", buffer); + closelog(); + +#ifdef DEBUG + fprintf(stderr, "(err) %s\n", buffer); +#endif + +} |