]> git.donarmstrong.com Git - infobot.git/blobdiff - src/logger.pl
supressed subroutine redefined warning. Added sql debug support (open/close)
[infobot.git] / src / logger.pl
index 454b36360041025f98af6eaf9cd841e2739f742c..dfb64e01b572a6e22bb1714716e23a8afe97fab2 100644 (file)
@@ -162,6 +162,8 @@ sub ERROR {
 sub WARN {
     return unless (&IsParam("WARN"));
 
+    return if ($_[0] =~ /^PERL: Subroutine \S+ redefined at/);
+
     &status("${b_yellow}!WARN!$ob $_[0]");
 }
 
@@ -312,4 +314,21 @@ sub status {
     print LOG sprintf("%s %s\n", $date, $input);
 }
 
+sub openSQLDebug {
+    if (!open(SQLDEBUG, $param{'SQLDebug'})) {
+       &ERROR("cannot open $param{'SQLDebug'}...");
+       delete $param{'SQLDebug'};
+       return 0;
+    }
+
+    &status("Opened SQL Debug file: $param{'SQLDebug'}");
+    return 1;
+}
+
+sub closeSQLDebug {
+    close SQLDEBUG;
+
+    &status("Closed SQL Debug file: $param{'SQLDebug'}");
+}
+
 1;