#include <time.h>
#ifndef HOST_WIN32
#include <sys/time.h>
+#else
+#include <process.h>
#endif
#include "mono-logger.h"
}
nLog = sizeof(logMessage) - iLog - 2;
iLog = vsnprintf(logMessage+iLog, nLog, format, args);
+#ifdef HOST_WIN32
+ logMessage[iLog++] = '\r';
+#endif
logMessage[iLog++] = '\n';
logMessage[iLog++] = '\0';
fputs(logMessage, logFile);
#include <glib.h>
#include <errno.h>
#include <time.h>
+#include <process.h>
#include "mono-logger.h"
static FILE *logFile = NULL;
static void *logUserData = NULL;
-static char *logFileName = L".//mono.log";
+static char logFileName[] = L".//mono.log";
/**
* mapSyslogLevel:
}
/**
- * mono_log_open_logfile
+ * mono_log_open_syslog
*
- * Open the logfile. If the path is not specified default to stdout. If the
- * open fails issue a warning and use stdout as the log file destination.
+ * Open the syslog file. If the open fails issue a warning and
+ * use stdout as the log file destination.
*
* @ident - Identifier: ignored
* @userData - Not used
if (logFile == NULL) {
g_warning("opening of log file %s failed with %s",
strerror(errno));
+ logFile = stdout;
}
logUserData = userData;
}
/**
- * mono_log_write_logfile
+ * mono_log_write_syslog
*
- * Write data to the log file.
+ * Write data to the syslog file.
*
* @domain - Identifier string
* @level - Logging level flags
size_t nLog;
if (logFile == NULL)
- mono_log_open_logfile(NULL, NULL);
+ mono_log_open_syslog(NULL, NULL);
time(&t);
tod = localtime(&t);
logTime,mapLogFileLevel(level),pid);
nLog = sizeof(logMessage) - iLog - 2;
iLog = vsnprintf(logMessage+iLog, nLog, format, args);
+ logMessage[iLog++] = '\r';
logMessage[iLog++] = '\n';
logMessage[iLog++] = 0;
fputs(logMessage, logFile);
}
/**
- * mono_log_close_logfile
+ * mono_log_close_syslog
*
- * Close the log file
+ * Close the syslog file
*/
void
mono_log_close_syslog()
<ClCompile Include="..\mono\utils\mono-logger.c" />\r
<ClCompile Include="..\mono\utils\mono-log-windows.c" />\r
<ClCompile Include="..\mono\utils\mono-log-common.c" />\r
- <ClCompile Include="..\mono\utils\mono-log-posix.c" />\r
<ClCompile Include="..\mono\utils\mono-math.c" />\r
<ClCompile Include="..\mono\utils\mono-md5.c" />\r
<ClCompile Include="..\mono\utils\mono-mmap.c" />\r