guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Mathieu Othacehe
Date: Sat, 3 Oct 2020 02:29:02 -0400 (EDT)

branch: master
commit 91de9bbc5a2d7b1d7732ffe6b9cc49874a923f50
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sat Oct 3 08:06:56 2020 +0200

    Add date to SQL queries log file.
    
    * src/cuirass/logging.scm (log-query): Add date.
---
 src/cuirass/logging.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/cuirass/logging.scm b/src/cuirass/logging.scm
index 97eb6f7..3982ef2 100644
--- a/src/cuirass/logging.scm
+++ b/src/cuirass/logging.scm
@@ -84,7 +84,14 @@
   (make-parameter #f))
 
 (define (log-query query time)
-  (format (query-logging-port) "~a ~,2f~%"
+  (define now
+    (current-time time-utc))
+
+  (define date
+    (date->string (time-utc->date now) "~5"))
+
+  (format (query-logging-port) "~a ~a ~,2f~%"
+          date
           (string-join
            (string-tokenize query
                             (char-set-complement



reply via email to

[Prev in Thread] Current Thread [Next in Thread]