dovecot-1.3: doveadm: Log to stderr.

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 10 21:15:07 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.3/rev/4f64d429985a
changeset: 9066:4f64d429985a
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Apr 10 14:15:03 2009 -0400
description:
doveadm: Log to stderr.

diffstat:

3 files changed, 11 insertions(+), 2 deletions(-)
src/lib-master/master-service.c |    5 +++++
src/lib-master/master-service.h |    4 +++-
src/util/doveadm.c              |    4 +++-

diffs (43 lines):

diff -r 52eb87931e91 -r 4f64d429985a src/lib-master/master-service.c
--- a/src/lib-master/master-service.c	Fri Apr 10 14:14:45 2009 -0400
+++ b/src/lib-master/master-service.c	Fri Apr 10 14:15:03 2009 -0400
@@ -113,6 +113,11 @@ void master_service_init_log(struct mast
 {
 	const char *path;
 
+	if ((service->flags & MASTER_SERVICE_FLAG_LOG_TO_STDERR) != 0) {
+		i_set_failure_file("/dev/stderr", "");
+		return;
+	}
+
 	if (getenv("LOG_TO_MASTER") != NULL && !service->log_directly) {
 		/* logging via master process */
 		i_set_failure_internal();
diff -r 52eb87931e91 -r 4f64d429985a src/lib-master/master-service.h
--- a/src/lib-master/master-service.h	Fri Apr 10 14:14:45 2009 -0400
+++ b/src/lib-master/master-service.h	Fri Apr 10 14:15:03 2009 -0400
@@ -7,7 +7,9 @@ enum master_service_flags {
 	/* stdin/stdout already contains a client which we want to serve */
 	MASTER_SERVICE_FLAG_STD_CLIENT		= 0x01,
 	/* this process is currently running standalone without a master */
-	MASTER_SERVICE_FLAG_STANDALONE		= 0x02
+	MASTER_SERVICE_FLAG_STANDALONE		= 0x02,
+	/* Log to stderr instead of the configured log file */
+	MASTER_SERVICE_FLAG_LOG_TO_STDERR	= 0x04
 };
 
 struct master_service;
diff -r 52eb87931e91 -r 4f64d429985a src/util/doveadm.c
--- a/src/util/doveadm.c	Fri Apr 10 14:14:45 2009 -0400
+++ b/src/util/doveadm.c	Fri Apr 10 14:15:03 2009 -0400
@@ -85,7 +85,9 @@ int main(int argc, char *argv[])
 	const char *getopt_str, *user;
 	int c;
 
-	service = master_service_init("doveadm", MASTER_SERVICE_FLAG_STANDALONE,
+	service = master_service_init("doveadm",
+				      MASTER_SERVICE_FLAG_STANDALONE |
+				      MASTER_SERVICE_FLAG_LOG_TO_STDERR,
 				      argc, argv);
 
 	user = getenv("USER");


More information about the dovecot-cvs mailing list