projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OE: single-dbh
[kivitendo-erp.git]
/
SL
/
LXDebug.pm
diff --git
a/SL/LXDebug.pm
b/SL/LXDebug.pm
index
cf6c912
..
d3ab1e5
100644
(file)
--- 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 constant STDERR_TARGET => 1;
use Data::Dumper;
-use POSIX qw(strftime getp
p
id);
+use POSIX qw(strftime getpid);
use Time::HiRes qw(gettimeofday tv_interval);
use YAML;
use SL::Request ();
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();
no warnings;
my ($self, $prefix, $message) = @_;
my @now = gettimeofday();
- my $date = strftime("%Y-%m-%d %H:%M:%S." . sprintf('%03d', int($now[1] / 1000)) . " $$ [" . getp
p
id() . "] ${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);
local *FILE;
chomp($message);
@@
-274,6
+274,7
@@
sub _write_raw {
local *FILE;
if ((FILE_TARGET == $self->{"target"})
&& open(FILE, ">>", $self->{"file"})) {
local *FILE;
if ((FILE_TARGET == $self->{"target"})
&& open(FILE, ">>", $self->{"file"})) {
+ binmode FILE, ":utf8";
print FILE $message;
close FILE;
print FILE $message;
close FILE;
@@
-295,9
+296,10
@@
sub begin_request {
}
sub end_request {
}
sub end_request {
- my
$self = shift
;
+ my
($self, %params) = @_
;
return 1 unless want_request_timer();
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;
}
$self->{calldepth} = 0;
}