: 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 ;
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 -- )
finally ; inline
: timestamp-header. ( -- )
- "[" write now (timestamp>rfc3339) "] " write ;
+ "[" write now write-timestamp "] " write ;
: multiline-header ( -- str ) 20 CHAR: - <string> ; foldable