report: Deno std logging timestamp options #4

Closed
pi wants to merge 0 commits from pi/issue3-1783973956547 into master
Contributor

Report: Timestamp options with Deno std logging

Investigates what @std/log provides for timestamped logging, as requested in #3.

Key findings

  • @std/log captures a timestamp automatically — every LogRecord has a datetime: Date field set at log-call time.
  • No built-in human-readable timestamp formatter — the default formatter ("INFO Hello, world!") ignores the timestamp entirely. The only built-in formatter that includes it is jsonFormatter, which emits datetime as epoch milliseconds.
  • To get a readable timestamp, supply a custom formatter function to ConsoleHandler / FileHandler. The report documents 5 approaches (ISO 8601, custom local format, locale string, JSON, JSON+ISO).

Recommendation

If we adopt @std/log, use a custom formatter with r.datetime.toISOString() for console output — it's UTC, unambiguous, and trivially parseable. The migration is mechanical: one setup() call at program start, then swap console.*logger.*.

Full details in reports/0003-deno-std-logging-timestamps.md.

Closes #3

## Report: Timestamp options with Deno std logging Investigates what `@std/log` provides for timestamped logging, as requested in #3. ### Key findings - **`@std/log` captures a timestamp automatically** — every `LogRecord` has a `datetime: Date` field set at log-call time. - **No built-in human-readable timestamp formatter** — the default formatter (`"INFO Hello, world!"`) ignores the timestamp entirely. The only built-in formatter that includes it is `jsonFormatter`, which emits `datetime` as epoch milliseconds. - **To get a readable timestamp, supply a custom `formatter` function** to `ConsoleHandler` / `FileHandler`. The report documents 5 approaches (ISO 8601, custom local format, locale string, JSON, JSON+ISO). ### Recommendation If we adopt `@std/log`, use a custom formatter with `r.datetime.toISOString()` for console output — it's UTC, unambiguous, and trivially parseable. The migration is mechanical: one `setup()` call at program start, then swap `console.*` → `logger.*`. Full details in `reports/0003-deno-std-logging-timestamps.md`. Closes #3
report: Deno std logging timestamp options
Some checks failed
CI / check (pull_request) Failing after 4s
77466be8ef
Co-authored-by: alex <alex@forge.l3x.in>
alex closed this pull request 2026-07-14 02:01:54 +00:00
alex deleted branch pi/issue3-1783973956547 2026-07-14 02:01:59 +00:00
Some checks failed
CI / check (pull_request) Failing after 4s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
dependencies
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
alex/irc-greeter-bot!4
No description provided.