File: syslog.c

package info (click to toggle)
python-scrypt 0.9.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 832 kB
  • sloc: ansic: 6,290; python: 733; sh: 99; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifdef _MSC_VER

#include <stdarg.h>
#include <stdio.h>
#include <windows.h>
#include <syslog.h>

/* Implementation of syslog for Windows */
void 
syslog(int priority, const char *format, ...)
{
    va_list args;
    char buffer[4096]; /* Using a reasonable buffer size */
    
    va_start(args, format);
    vsnprintf(buffer, sizeof(buffer), format, args);
    va_end(args);
    
    /* Log to Windows event log or just output to stderr */
    fprintf(stderr, "syslog: %s", buffer);
}

/* Implementation of closelog for Windows */
void 
closelog(void)
{
    /* Do nothing on Windows */
}

#endif /* _MSC_VER */