From 5aed7f6775777b2a6166d6eddffaa976eb4fac8b Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Thu, 24 Sep 2009 17:50:13 +0200 Subject: Added extra parameter to eurephia_log_init() to set log ident for syslog --- common/eurephia_log.c | 5 +++-- common/eurephia_log.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/eurephia_log.c b/common/eurephia_log.c index 94c901a..dde99d8 100644 --- a/common/eurephia_log.c +++ b/common/eurephia_log.c @@ -270,6 +270,7 @@ void eurephia_log_close(eurephiaCTX *ctx) { * Initialises and preapres the log device * * @param ctx eurephiaCTX where the log context will be associated + * @param ident Log ident. Used when logging to syslog primarily, to identify log entries in syslog logs * @param dest Log destination. For can be a file name, "syslog:", "stdout:", "stderr:" or "none:". * If it is "syslog:" it must continue with a string describing log facility such as * "syslog:authpriv", "syslog:local0", "syslog:local1", "syslog:user", etc. If the @@ -279,7 +280,7 @@ void eurephia_log_close(eurephiaCTX *ctx) { * * @return Returns 1 on success, otherwise 0; */ -int eurephia_log_init(eurephiaCTX *ctx, const char *dest, int loglevel) { +int eurephia_log_init(eurephiaCTX *ctx, const char *ident, const char *dest, int loglevel) { assert( (ctx != NULL) && (dest != NULL) ); @@ -322,7 +323,7 @@ int eurephia_log_init(eurephiaCTX *ctx, const char *dest, int loglevel) { break; case logSYSLOG: // Open syslog - openlog("eurephia", LOG_PID, syslog_logdest(ctx->log->destination)); + openlog(ident, LOG_PID, syslog_logdest(ctx->log->destination)); break; } ctx->log->opened = 1; diff --git a/common/eurephia_log.h b/common/eurephia_log.h index 77511d0..d059735 100644 --- a/common/eurephia_log.h +++ b/common/eurephia_log.h @@ -54,7 +54,7 @@ #warning ########################################################################################## #endif -int eurephia_log_init(eurephiaCTX *ctx, const char *dest, int loglvl); +int eurephia_log_init(eurephiaCTX *ctx, const char *ident, const char *dest, int loglvl); void eurephia_log_close(eurephiaCTX *ctx); /** -- cgit