Watt-32 tcp/ip  2.2 dev-rel.10
Functions | Variables
syslog.c File Reference

Go to the source code of this file.

Functions

void W32_CDECL syslog (int pri, const char *fmt,...)
 
void W32_CALL vsyslog (int pri, const char *fmt, va_list ap)
 
static const char * getlogname (void)
 
static int openloghost (char **errbuf)
 
static void _closelog (void)
 
void W32_CALL openlog (const char *ident, int logstat, int logfac)
 
int W32_CALL setlogmask (int new_mask)
 
char *W32_CALL setlogtag (char *new_tag)
 
void W32_CALL closelog (void)
 
int main (void)
 

Variables

static sock_typelog_sock = NULL
 
static FILE * log_file = NULL
 
static DWORD log_host = 0UL
 
static BOOL log_opened = FALSE
 
static int log_stat = 0
 
static char * log_tag = NULL
 
static int log_mask = LOG_INFO
 
static DWORD log_facil = LOG_USER
 
CODE prioritynames []
 
CODE facilitynames []
 

Detailed Description

Simple syslog handler for Watt-32.

Loosely based on BSD-version. by Gisle Vanem gvane.nosp@m.m@ya.nosp@m.hoo.n.nosp@m.o Jun-99

This module really belongs to the application layer, but is included in Watt-32 for convenience.

Note
syslog_init() must be called in watt_sock_init() (or prior to that). openlog() and syslog() cannot be used before watt_sock_init() is called.
Todo:
configure variables in syslog2.c when calling openlog() thus making syslog() independent of watt_sock_init().

Definition in file syslog.c.

Variable Documentation

CODE facilitynames[]
Initial value:
= {
{ LOG_AUTH, "auth" },
{ LOG_AUTHPRIV, "authpriv" },
{ LOG_CRON, "cron" },
{ LOG_DAEMON, "daemon" },
{ LOG_FTP, "ftp" },
{ LOG_KERN, "kern" },
{ LOG_LPR, "lpr" },
{ LOG_MAIL, "mail" },
{ INTERNAL_MARK, "mark" },
{ LOG_NEWS, "news" },
{ LOG_NTP, "ntp" },
{ LOG_AUTH, "security" },
{ LOG_SYSLOG, "syslog" },
{ LOG_USER, "user" },
{ LOG_UUCP, "uucp" },
{ LOG_LOCAL0, "local0" },
{ LOG_LOCAL1, "local1" },
{ LOG_LOCAL2, "local2" },
{ LOG_LOCAL3, "local3" },
{ LOG_LOCAL4, "local4" },
{ LOG_LOCAL5, "local5" },
{ LOG_LOCAL6, "local6" },
{ LOG_LOCAL7, "local7" },
{ -1, NULL }
}

Definition at line 84 of file syslog.c.

CODE prioritynames[]
Initial value:
= {
{ LOG_ALERT, "alert" },
{ LOG_CRIT, "crit" },
{ LOG_DEBUG, "debug" },
{ LOG_EMERG, "emerg" },
{ LOG_ERR, "err" },
{ LOG_ERR, "error" },
{ LOG_INFO, "info" },
{ INTERNAL_NOPRI, "none" },
{ LOG_NOTICE, "notice" },
{ LOG_EMERG, "panic" },
{ LOG_WARNING, "warn" },
{ LOG_WARNING, "warning" },
{ -1, NULL }
}

Definition at line 68 of file syslog.c.