summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2009-05-12 11:48:20 +0200
committerSylvestre Ledru <sylvestre.ledru@scilab.org>2009-05-12 11:48:20 +0200
commitc35382b0ad96caf854d8f36d28efed1f755652b3 (patch)
tree88417fac632b8f68a04b0d75c3b732b36b0cbf81
parentd728f45dda9425d2133e6e1a5ee8838e0690e39d (diff)
parent78f1b525520b5469d44601ec27460e0491a39a81 (diff)
downloadscilab-c35382b0ad96caf854d8f36d28efed1f755652b3.zip
scilab-c35382b0ad96caf854d8f36d28efed1f755652b3.tar.gz
Merge commit 'refs/remotes/origin/5.1'
-rw-r--r--scilab/modules/spreadsheet/src/c/ripole/logger.c15
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
21static int _LOGGER_mode = _LOGGER_SYSLOG; 23static int _LOGGER_mode = _LOGGER_SYSLOG;
22static int _LOGGER_syslog_mode = LOG_MAIL|LOG_INFO; 24static 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);