diff options
-rw-r--r-- | scilab/modules/spreadsheet/src/c/ripole/logger.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scilab/modules/spreadsheet/src/c/ripole/logger.c b/scilab/modules/spreadsheet/src/c/ripole/logger.c index 1d2e261..5c59746 100644 --- a/scilab/modules/spreadsheet/src/c/ripole/logger.c +++ b/scilab/modules/spreadsheet/src/c/ripole/logger.c | |||
@@ -17,6 +17,8 @@ | |||
17 | #include "MALLOC.h" | 17 | #include "MALLOC.h" |
18 | #include "charEncoding.h" | 18 | #include "charEncoding.h" |
19 | 19 | ||
20 | //#define SYSLOG_ENABLE 1 | ||
21 | |||
20 | #ifndef _MSC_VER | 22 | #ifndef _MSC_VER |
21 | static int _LOGGER_mode = _LOGGER_SYSLOG; | 23 | static int _LOGGER_mode = _LOGGER_SYSLOG; |
22 | static int _LOGGER_syslog_mode = LOG_MAIL|LOG_INFO; | 24 | static int _LOGGER_syslog_mode = LOG_MAIL|LOG_INFO; |
@@ -114,7 +116,7 @@ int LOGGER_set_logfile( char *lfname ) | |||
114 | wcfopen(_LOGGER_outf, lfname, "a"); | 116 | wcfopen(_LOGGER_outf, lfname, "a"); |
115 | if (!_LOGGER_outf) | 117 | if (!_LOGGER_outf) |
116 | { | 118 | { |
117 | #ifndef _MSC_VER | 119 | #if !defined(_MSC_VER) && defined(SYSLOG_ENABLE) |
118 | syslog(1,_("LOGGER_set_logfile: ERROR - Cannot open logfile '%s' (%s)"),lfname,strerror(errno)); | 120 | syslog(1,_("LOGGER_set_logfile: ERROR - Cannot open logfile '%s' (%s)"),lfname,strerror(errno)); |
119 | #else | 121 | #else |
120 | fprintf(stderr, _("LOGGER_set_logfile: ERROR - Cannot open logfile '%s' (%s)\n"), lfname, strerror(errno)); | 122 | fprintf(stderr, _("LOGGER_set_logfile: ERROR - Cannot open logfile '%s' (%s)\n"), lfname, strerror(errno)); |
@@ -323,14 +325,15 @@ int LOGGER_log( char *format, ...) | |||
323 | 325 | ||
324 | /* Send the output to the appropriate output destination*/ | 326 | /* Send the output to the appropriate output destination*/ |
325 | switch (_LOGGER_mode) { | 327 | switch (_LOGGER_mode) { |
326 | case _LOGGER_STDERR: | ||
327 | fprintf(stderr,"%s%s",output, lineend ); | ||
328 | break; | ||
329 | case _LOGGER_SYSLOG: | 328 | case _LOGGER_SYSLOG: |
330 | #ifndef _MSC_VER | 329 | #if !defined(_MSC_VER) && defined(SYSLOG_ENABLE) |
331 | syslog(_LOGGER_syslog_mode,"%s",output); | 330 | syslog(_LOGGER_syslog_mode,"%s",output); |
332 | #endif | ||
333 | break; | 331 | break; |
332 | #endif | ||
333 | case _LOGGER_STDERR: | ||
334 | fprintf(stderr,"%s%s",output, lineend ); | ||
335 | break; | ||
336 | |||
334 | case _LOGGER_STDOUT: | 337 | case _LOGGER_STDOUT: |
335 | fprintf(stdout,"%s%s",output, lineend); | 338 | fprintf(stdout,"%s%s",output, lineend); |
336 | fflush(stdout); | 339 | fflush(stdout); |