From 5ebb93d2534ebf26b56e0ceb9b08aa5772d62cdc Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Sat, 16 Apr 2011 19:14:06 +1000 Subject: [PATCH] Log to stdout by default. --- darkhttpd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/darkhttpd.c b/darkhttpd.c index d453ca2..46949fa 100644 --- a/darkhttpd.c +++ b/darkhttpd.c @@ -858,7 +858,7 @@ static void usage(void) { "\t\tSpecifies how many concurrent connections to accept.\n" "\n"); printf( - "\t--log filename (default: no logging)\n" + "\t--log filename (default: stdout)\n" "\t\tSpecifies which file to append the request log to.\n" "\n"); printf( @@ -2335,7 +2335,9 @@ int main(int argc, char **argv) { init_sockin(); /* open logfile */ - if (logfile_name != NULL) { + if (logfile_name == NULL) + logfile = stdout; + else { logfile = fopen(logfile_name, "ab"); if (logfile == NULL) err(1, "opening logfile: fopen(\"%s\")", logfile_name);