diff options
Diffstat (limited to 'logs.c')
-rw-r--r-- | logs.c | 71 |
1 files changed, 70 insertions, 1 deletions
@@ -2,7 +2,7 @@ int bbs_log( const char *syslname ) { - int ret; + int ret=0; char *term=NULL; setlogmask (LOG_UPTO (LOG_NOTICE)); @@ -15,6 +15,7 @@ int bbs_log( const char *syslname ) openlog ( syslname, LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1 ); } + //maybe fake visitor term = getenv( "TERM" ); if ( term != NULL ) syslog (LOG_NOTICE, "BBS visitor with TERM=%s", term); @@ -26,4 +27,72 @@ int bbs_log( const char *syslname ) return ret; } +int bbs_log_article( const char *syslname ) +{ + int ret=0; + + 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 ); + } + + //probably not fake visitor + syslog( LOG_NOTICE, "BBS article" ); + + closelog (); + + + return ret; +} + + +int bbs_log_motd( const char *syslname ) +{ + int ret=0; + + 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 ); + } + + syslog( LOG_NOTICE, "BBS motd" ); + + closelog (); + + + return ret; +} + +int bbs_log_quit( const char *syslname ) +{ + int ret=0; + + 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 ); + } + + syslog( LOG_NOTICE, "BBS quit" ); + + closelog (); + + + return ret; +} + |