summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();