generated from alex/base-template
Timestamps for logs #3
Labels
No labels
dependencies
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
alex/irc-greeter-bot#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
See what options Deno std provides for logging
/pi new report
Let me investigate what Deno std's
@std/logmodule provides, particularly regarding timestamp formatting.Now I have a thorough understanding. Let me compile the findings into a report. The key finding is that Deno std's@std/logprovides aLogRecordwith adatetimefield and customformatterfunctions for handlers, but does not have a built-in timestamp formatter — you must supply your own.Now let me create a PR with the report:Report created in PR #4.Summary of findings:
Deno std's
@std/log(v0.224.14) does capture timestamps — everyLogRecordhas adatetime: Datefield set at the moment of the log call. However, it does not provide a built-in formatter that renders that timestamp as a human-readable string:"INFO Hello, world!").jsonFormatterincludes it, but only as epoch milliseconds (1783973885167).To get a readable timestamp, you supply a custom
formatterfunction toConsoleHandlerorFileHandler. The report documents 5 approaches, with ISO 8601 viar.datetime.toISOString()recommended as the simplest and most robust:The migration would be mechanical: one
setup()call at startup, then replace eachconsole.info/console.errorwithlogger.info/logger.error.View action run | Model: zai/glm-5.2 (thinking: max) | Time: 3m 10s | Tokens: 386.7K | Pi SDK v0.80.6 | Action v2.25.1-develop (develop @ 9c24480)