On 04.12.20 18:56, Stoiko Ivanov wrote: > Suggested-by: Thomas Lamprecht <t.lampre...@proxmox.com> > Signed-off-by: Stoiko Ivanov <s.iva...@proxmox.com> > --- > PVE/APIServer/AnyEvent.pm | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/PVE/APIServer/AnyEvent.pm b/PVE/APIServer/AnyEvent.pm > index c55da7f..7916bdd 100644 > --- a/PVE/APIServer/AnyEvent.pm > +++ b/PVE/APIServer/AnyEvent.pm > @@ -66,6 +66,16 @@ my $split_abs_uri = sub { > return wantarray ? ($rel_uri, $format) : $rel_uri; > }; > > +sub dprint { > + my ($self, $message) = @_; > + > + return if !$self->{debug}; > + > + my ($pkg, $pkgfile, $line, $sub) = caller(1); > + $sub =~ s/^.+::([^:]+)$/\1/;
Could be a bit simpler, avoiding capturing group and back reference: $sub =~ s/^(?:.+::)+//; (note did not actually test it) > + print "worker[$$]: $pkg +$line: $sub: $message\n"; > +} > + > sub log_request { > my ($self, $reqstate) = @_; > > please merge 5/5 into this one, makes no sense to have that split and the use part ordered last. _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel