]> gitweb.factorcode.org Git - factor.git/commitdiff
logging: fix uses of (timestamp>string).
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 9 Dec 2020 23:35:24 +0000 (15:35 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 9 Dec 2020 23:35:24 +0000 (15:35 -0800)
basis/calendar/format/format.factor
basis/logging/parser/parser.factor
basis/logging/server/server.factor

index bc88725e1804a3f0112cc120c548bdd223cddde1..b80d99a636203b8f1f90e960c0901deb707100fe 100644 (file)
@@ -168,10 +168,11 @@ ALIAS: timestamp>rfc822 timestamp>rfc2822
 : timestamp>cookie-string ( timestamp -- str )
     >gmt timestamp>rfc1036 ;
 
+: write-timestamp ( timestamp -- )
+    { DAY ", " D " " MONTH " " YYYY " " hh ":" mm ":" ss } formatted ;
+
 : timestamp>string ( timestamp -- str )
-    [
-        { DAY ", " D " " MONTH " " YYYY " " hh ":" mm ":" ss } formatted
-    ] with-string-writer ;
+    [ write-timestamp ] with-string-writer ;
 
 M: timestamp present timestamp>string ;
 
index 6b23b7dd58756fa2328595f633b07dae2d07a7ce..b5417255b1ecea9df698c9325fa0966861abbd28 100644 (file)
@@ -86,7 +86,7 @@ PEG: parse-log-line ( string -- entry ) log-line-parser ;
 
 GENERIC: log-timestamp. ( date -- )
 
-M: timestamp log-timestamp. (timestamp>string) ;
+M: timestamp log-timestamp. write-timestamp ;
 M: word log-timestamp. drop "multiline" write ;
 
 : log-entry. ( entry -- )
index 8240dcc26e0a1bb44fa4cead93696cd048a28afa..770d3011b9e11fa54c68fbd58c5ea709e9cd4e37 100644 (file)
@@ -36,7 +36,7 @@ SYMBOL: log-files
     finally ; inline
 
 : timestamp-header. ( -- )
-    "[" write now (timestamp>rfc3339) "] " write ;
+    "[" write now write-timestamp "] " write ;
 
 : multiline-header ( -- str ) 20 CHAR: - <string> ; foldable