X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLXDebug.pm;h=d3ab1e53a7ec8a66089d7385385b0845fdd5d038;hb=f9a93e326337ed219de49f575c02e5a8cb36a1b6;hp=cf6c91266f4977beaa627c9fa8ad79710ced9e37;hpb=313c7c4d7422770b3f28ce0b5d51f867472e1fce;p=kivitendo-erp.git diff --git a/SL/LXDebug.pm b/SL/LXDebug.pm index cf6c91266..d3ab1e53a 100644 --- a/SL/LXDebug.pm +++ b/SL/LXDebug.pm @@ -18,7 +18,7 @@ use constant FILE_TARGET => 0; use constant STDERR_TARGET => 1; use Data::Dumper; -use POSIX qw(strftime getppid); +use POSIX qw(strftime getpid); use Time::HiRes qw(gettimeofday tv_interval); use YAML; use SL::Request (); @@ -262,7 +262,7 @@ sub _write { no warnings; my ($self, $prefix, $message) = @_; my @now = gettimeofday(); - my $date = strftime("%Y-%m-%d %H:%M:%S." . sprintf('%03d', int($now[1] / 1000)) . " $$ [" . getppid() . "] ${prefix}: ", localtime($now[0])); + my $date = strftime("%Y-%m-%d %H:%M:%S." . sprintf('%03d', int($now[1] / 1000)) . " $$ [" . getpid() . "] ${prefix}: ", localtime($now[0])); local *FILE; chomp($message); @@ -274,6 +274,7 @@ sub _write_raw { local *FILE; if ((FILE_TARGET == $self->{"target"}) && open(FILE, ">>", $self->{"file"})) { + binmode FILE, ":utf8"; print FILE $message; close FILE; @@ -295,9 +296,10 @@ sub begin_request { } sub end_request { - my $self = shift; + my ($self, %params) = @_; return 1 unless want_request_timer(); - $self->_write("time", $self->get_request_time); + + $self->_write("time", sprintf('%f (%s/%s)', $self->get_request_time, $params{script_name}, $params{action})); $self->{calldepth} = 0; }