[pve-devel] superseded: [PATCH pve-http-server] AnyEvent: add timestamps to debug logs
Laurențiu Leahu-Vlăducu
l.leahu-vladucu at proxmox.com
Tue Oct 21 16:15:02 CEST 2025
Superseded-by:
https://lore.proxmox.com/pve-devel/20251021141030.185691-1-l.leahu-vladucu@proxmox.com/T/#u
On 02.10.25 18:28, Laurențiu Leahu-Vlăducu wrote:
> This helps correlate our debug logs with other log files for
> easier debugging when making API calls.
>
> Signed-off-by: Laurențiu Leahu-Vlăducu <l.leahu-vladucu at proxmox.com>
> ---
> src/PVE/APIServer/AnyEvent.pm | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm
> index 59bc184..cdc82b2 100644
> --- a/src/PVE/APIServer/AnyEvent.pm
> +++ b/src/PVE/APIServer/AnyEvent.pm
> @@ -76,7 +76,9 @@ sub dprint {
>
> my ($pkg, $pkgfile, $line, $sub) = caller(1);
> $sub =~ s/^(?:.+::)+//;
> - print "worker[$$]: $pkg +$line: $sub: $message\n";
> + my ($secs, $microsecs) = gettimeofday();
> + my $timestr = strftime("%F %T", localtime($secs)) . sprintf(".%06d", $microsecs);
> + print "$timestr | worker[$$]: $pkg +$line: $sub: $message\n";
> }
>
> sub log_request {
More information about the pve-devel
mailing list