summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2007-10-23 09:14:10 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2007-10-23 09:14:10 (GMT)
commit424295fd59a96dffdb3b94a27d91d5d27409a968 (patch)
treed3b633d04754d908ee20a814869690295c63168e
parentafb4f8e6bea0ddc503741488daaa0435a26d7396 (diff)
downloadperl-Kolab-2.1-stable.tar.gz
Show component and log level when sending debug log to stdout.2.1-stable
-rw-r--r--Kolab/Kolab.pm.in23
1 files changed, 10 insertions, 13 deletions
diff --git a/Kolab/Kolab.pm.in b/Kolab/Kolab.pm.in
index 7d58778..cf72ceb 100644
--- a/Kolab/Kolab.pm.in
+++ b/Kolab/Kolab.pm.in
@@ -464,20 +464,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'};
}
reloadConfig();