summaryrefslogtreecommitdiff
path: root/logs.c
diff options
context:
space:
mode:
Diffstat (limited to 'logs.c')
-rw-r--r--logs.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/logs.c b/logs.c
new file mode 100644
index 0000000..7ec8efe
--- /dev/null
+++ b/logs.c
@@ -0,0 +1,29 @@
+#include "logs.h"
+
+int bbs_log( const char *syslname )
+{
+ int ret;
+ char *term=NULL;
+
+ setlogmask (LOG_UPTO (LOG_NOTICE));
+
+ if ( syslname == NULL )
+ {
+ openlog ( BBS_DEFAULT_SYSLOG, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
+ } else
+ {
+ openlog ( syslname, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1 );
+ }
+
+ term = getenv( "TERM" );
+ if ( term != NULL )
+ syslog (LOG_NOTICE, "BBS visitor with TERM=%s", term);
+ else
+ syslog( LOG_NOTICE, "BBS visitor" );
+
+ closelog ();
+
+ return ret;
+}
+
+