write_msg() is used by both the server and the test suite. In
authordjfiander <djfiander>
Tue, 6 Jun 2006 01:18:38 +0000 (01:18 +0000)
committerdjfiander <djfiander>
Tue, 6 Jun 2006 01:18:38 +0000 (01:18 +0000)
the test suite, we don't want to call syslog, so only call syslog
if we're writing the message to stdout (which only happens in the
server).

Sip.pm

diff --git a/Sip.pm b/Sip.pm
index 36a0f53..f65aecf 100644 (file)
--- a/Sip.pm
+++ b/Sip.pm
@@ -148,12 +148,12 @@ sub write_msg {
        $msg .= sprintf('%4X', $cksum);
     }
 
-    syslog("LOG_DEBUG", "OUTPUT MSG: '$msg'");
 
     if ($file) {
        print $file "$msg\r";
     } else {
        print "$msg\r";
+       syslog("LOG_DEBUG", "OUTPUT MSG: '$msg'");
     }
 
     $last_response = $msg;