# This program can be used to send Status update messages to the Spong Server
# from shell scripts or other external programs.
#
-# $Id: spong-status.pl,v 1.8 2001/09/28 21:21:35 sljohnson Exp $
+# $Id: spong-status.pl,v 1.9 2002/06/04 01:10:01 sljohnson Exp $
use POSIX;
use Getopt::Long;
sub error { print STDERR scalar localtime,": $_\n"; }
+# This function initializes the debug and error logging contexts in the
+# Log module.
+
+sub init_logging {
+ if (defined $debuglevel) {
+ $debug = ($debuglevel == 0) ? 1 : $debuglevel
+ }
+
+ Spong::Log::set_debug_context( 'debuglevel' => $debug );
+
+ my $filename = ($SPONG_LOG_FILE) ? "$SPONGTMP/spong-server.log" : "";
+ my $syslog = ($SPONG_LOG_SYSLOG) ? 1 : 0;
+
+ Spong::Log::set_error_context( syslog => $syslog,
+ ident => 'spong-server',
+ logopt => 'pid,cons',
+ priority => 'ERR',
+ filename => $filename,
+ );
+
+}
+
+