[logging] Default to stdout if MONO_LOG_DEST is unset (#3272)
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Wed, 13 Jul 2016 15:21:01 +0000 (11:21 -0400)
committerGitHub <noreply@github.com>
Wed, 13 Jul 2016 15:21:01 +0000 (11:21 -0400)
Follow up to e70a8aca1cd575582459db406ab3410e53074b73, do what the man
page says and default to stdout if MONO_LOG_DEST isn't specified.

mono/utils/mono-logger.c

index 38c485212be072884592828e2d5597ac4279838f..8c6c5aa5512662c6825742cdea87985d042f3d00 100644 (file)
@@ -148,7 +148,7 @@ mono_trace_set_logdest_string (const char *dest)
        if(level_stack == NULL)
                mono_trace_init();
 
-       if ((dest != NULL) && (strcmp("syslog", dest) != 0)) {
+       if ((dest == NULL) || (strcmp("syslog", dest) != 0)) {
                logger.opener = mono_log_open_logfile;
                logger.writer = mono_log_write_logfile;
                logger.closer = mono_log_close_logfile;