summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2009-09-24 17:50:13 +0200
committerDavid Sommerseth <dazo@users.sourceforge.net>2009-09-24 17:50:13 +0200
commit5aed7f6775777b2a6166d6eddffaa976eb4fac8b (patch)
tree0e66547b8d3c2a2c19bdf76c2918de61899fd02d /common
parent343b51689a958ee35068699ba89f478893b7a12a (diff)
downloadeurephia-5aed7f6775777b2a6166d6eddffaa976eb4fac8b.tar.gz
eurephia-5aed7f6775777b2a6166d6eddffaa976eb4fac8b.tar.xz
eurephia-5aed7f6775777b2a6166d6eddffaa976eb4fac8b.zip
Added extra parameter to eurephia_log_init() to set log ident for syslog
Diffstat (limited to 'common')
-rw-r--r--common/eurephia_log.c5
-rw-r--r--common/eurephia_log.h2
2 files changed, 4 insertions, 3 deletions
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);
/**