mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-05-24 23:20:49 +00:00
disable debug messages in APIDaemon by default
This commit is contained in:
parent
78e9f56599
commit
ecbca9c355
@ -34,6 +34,16 @@ my $max_requests = 500; # max requests per worker
|
|||||||
my $child_terminate = 0;
|
my $child_terminate = 0;
|
||||||
my $child_reload_config = 0;
|
my $child_reload_config = 0;
|
||||||
|
|
||||||
|
my $debug_enabled;
|
||||||
|
sub enable_debug {
|
||||||
|
$debug_enabled = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub debug_msg {
|
||||||
|
return if !$debug_enabled;
|
||||||
|
syslog('info', @_);
|
||||||
|
}
|
||||||
|
|
||||||
sub worker_finished {
|
sub worker_finished {
|
||||||
my $cpid = shift;
|
my $cpid = shift;
|
||||||
|
|
||||||
@ -265,7 +275,7 @@ sub handle_requests {
|
|||||||
|
|
||||||
my $method = $r->method();
|
my $method = $r->method();
|
||||||
|
|
||||||
syslog('info', "perl method $method");
|
debug_msg("perl method $method");
|
||||||
|
|
||||||
if (!$known_methods->{$method}) {
|
if (!$known_methods->{$method}) {
|
||||||
$c->send_error(HTTP_NOT_IMPLEMENTED);
|
$c->send_error(HTTP_NOT_IMPLEMENTED);
|
||||||
@ -273,7 +283,7 @@ sub handle_requests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $uri = $r->uri->path();
|
my $uri = $r->uri->path();
|
||||||
syslog('info', "start $method $uri");
|
debug_msg("start $method $uri");
|
||||||
|
|
||||||
my ($rel_uri, $format) = PVE::REST::split_abs_uri($uri);
|
my ($rel_uri, $format) = PVE::REST::split_abs_uri($uri);
|
||||||
if (!$format) {
|
if (!$format) {
|
||||||
@ -318,7 +328,7 @@ sub handle_requests {
|
|||||||
$c->send_response($response);
|
$c->send_response($response);
|
||||||
}
|
}
|
||||||
|
|
||||||
syslog('info', "end $method $uri ($res->{status})");
|
debug_msg("end $method $uri ($res->{status})");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$rcount++;
|
$rcount++;
|
||||||
|
@ -31,6 +31,8 @@ $SIG{'__WARN__'} = sub {
|
|||||||
|
|
||||||
$0 = "pvedaemon";
|
$0 = "pvedaemon";
|
||||||
|
|
||||||
|
PVE::APIDaemon::enable_debug() if $opt_debug;
|
||||||
|
|
||||||
my $cpid;
|
my $cpid;
|
||||||
my $daemon;
|
my $daemon;
|
||||||
eval {
|
eval {
|
||||||
|
Loading…
Reference in New Issue
Block a user