all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH pve-http-server] AnyEvent: add timestamps to debug logs
@ 2025-10-02 16:28 Laurențiu Leahu-Vlăducu
  2025-10-13 17:01 ` Thomas Lamprecht
  2025-10-21 14:15 ` [pve-devel] superseded: " Laurențiu Leahu-Vlăducu
  0 siblings, 2 replies; 4+ messages in thread
From: Laurențiu Leahu-Vlăducu @ 2025-10-02 16:28 UTC (permalink / raw)
  To: pve-devel

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@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 {
-- 
2.47.3



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-21 14:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-02 16:28 [pve-devel] [PATCH pve-http-server] AnyEvent: add timestamps to debug logs Laurențiu Leahu-Vlăducu
2025-10-13 17:01 ` Thomas Lamprecht
2025-10-14  9:49   ` Laurențiu Leahu-Vlăducu
2025-10-21 14:15 ` [pve-devel] superseded: " Laurențiu Leahu-Vlăducu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal