Subject: | WARN and ERROR translates to wrong syslog levels |
Date: | Tue, 1 Oct 2019 15:09:41 +0200 |
To: | bug-Mojo-Log-Syslog [...] rt.cpan.org |
From: | Søren Schrøder <sch [...] chaos.dk> |
$log->warn("warn mojo lite");
$log->error("error mojo lite");
error:
syslog: invalid level/facility: LOG_WARN at
/usr/local/share/perl/5.24.1/Mojo/Log/Syslog.pm line 40.
FIX:
$ git diff Syslog.pm
diff --git a/lib/Mojo/Log/Syslog.pm b/lib/Mojo/Log/Syslog.pm
index 4582037..e4b3afc 100644
--- a/lib/Mojo/Log/Syslog.pm
+++ b/lib/Mojo/Log/Syslog.pm
@@ -24,9 +24,9 @@ sub new {
}
sub debug { shift->_syslog(debug => LOG_DEBUG => @_) }
-sub warn { shift->_syslog(warn => LOG_WARN => @_) }
+sub warn { shift->_syslog(warn => LOG_WARNING => @_) }
sub info { shift->_syslog(info => LOG_INFO => @_) }
-sub error { shift->_syslog(error => LOG_ERROR => @_) }
+sub error { shift->_syslog(error => LOG_CRIT => @_) }
sub fatal { shift->_syslog(fatal => LOG_CRIT => @_) }
sub _syslog {
--
Søren Schrøder.
Obey Gravity - It's the law !