summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2007-10-23 09:17:44 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2007-10-23 09:17:44 (GMT)
commit9eba0b3fa1c09369e70c802b374c0a47a5114359 (patch)
tree621e5404d2dc673ccec3b181b0a9c0643c1a3c69
parentfff4ead064aa3fd9f7c7a1a31b729685fcf0702b (diff)
downloadperl-Kolab-9eba0b3fa1c09369e70c802b374c0a47a5114359.tar.gz
Show component and log level when sending debug log to stdout.
-rw-r--r--ChangeLog5
-rw-r--r--lib/Kolab.pm23
2 files changed, 15 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index f8a1def..40fa4f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-23 Thomas Arendsen Hein <thomas@intevation.de>
+
+ * lib/Kolab.pm: Show component and log level when sending debug
+ log to stdout.
+
2007-10-17 Thomas Arendsen Hein <thomas@intevation.de>
* lib/Kolab.pm: kolab/issue934 (Remove FTP FreeBusy Service (proftpd))
diff --git a/lib/Kolab.pm b/lib/Kolab.pm
index 3cc641e..ddfdc66 100644
--- a/lib/Kolab.pm
+++ b/lib/Kolab.pm
@@ -422,20 +422,17 @@ sub log
my $text = shift;
my $priority = shift || KOLAB_INFO;
- my $level = $config{'log_level'};
- if ($level >= $priority) {
- if ($priority == KOLAB_ERROR) {
- $text = $prefix . ' Error: ' . $text;
- } elsif ($priority == KOLAB_WARN) {
- $text = $prefix . ' Warning: ' . $text;
- } elsif ($priority == KOLAB_DEBUG) {
- $text = $prefix . ' Debug: ' . $text;
- } else {
- $text = $prefix . ': ' . $text;
- }
- syslog('info', "$text");
+ if ($priority == KOLAB_ERROR) {
+ $text = $prefix . ' Error: ' . $text;
+ } elsif ($priority == KOLAB_WARN) {
+ $text = $prefix . ' Warning: ' . $text;
+ } elsif ($priority == KOLAB_DEBUG) {
+ $text = $prefix . ' Debug: ' . $text;
+ } else {
+ $text = $prefix . ': ' . $text;
}
- print STDERR "$text\n" if ($config{'debug'});
+ syslog('info', "$text") if $config{'log_level'} >= $priority;
+ print STDERR "$text\n" if $config{'debug'};
}
1;