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)
commit5107f8390343d186b083b7e412b870834f57f109 (patch)
tree907a4e4ba6f8c6b08f1acc60de98a4cc69c7df46
parent7bbad60d3c7dd924363b0273a89153b1159ceb3d (diff)
downloadkolab-server-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();