X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLXDebug.pm;h=b24372445157402e1726d6e9b1dbfa52642a6eb5;hb=606e7e2575ff6112e8e45acf0e74e87faa5cfa7c;hp=7d17aec6d719aa229695f913c195aa169492282d;hpb=847d924bbcaa4f6021d74c408f71319074103880;p=kivitendo-erp.git diff --git a/SL/LXDebug.pm b/SL/LXDebug.pm index 7d17aec6d..b24372445 100644 --- a/SL/LXDebug.pm +++ b/SL/LXDebug.pm @@ -39,6 +39,8 @@ sub new { my $type = shift; my $self = {}; + _init_globals_from_config(); + $self->{"calldepth"} = 0; $self->{"file"} = $file_name || "/tmp/lx-office-debug.log"; $self->{"target"} = FILE_TARGET; @@ -53,6 +55,22 @@ sub new { bless($self, $type); } +my $globals_inited_from_config; +sub _init_globals_from_config { + return if $globals_inited_from_config; + $globals_inited_from_config = 1; + + my $cfg = $::lx_office_conf{debug} || {}; + + $global_level = NONE() if $cfg->{global_level} =~ /NONE/; + foreach my $level (grep { $_} split(m/\s+/, $cfg->{global_level})) { + $global_level |= eval "${level}()"; + } + + $watch_form = $cfg->{watch_form}; + $file_name = $cfg->{file_name} || "/tmp/lx-office-debug.log"; +} + sub set_target { my ($self, $target, $file) = @_;