Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: add timestamp logs#200

Merged
timerring merged 1 commit intomainfrom
dev
Feb 21, 2026
Merged

chore: add timestamp logs#200
timerring merged 1 commit intomainfrom
dev

Conversation

@timerring
Copy link
Member

Summary

Adds a ts() helper function to reload-extension.mjs that returns the current local time in HH:MM:SS (24-hour) format. All console.log statements in the reload script now include this timestamp in their prefix, changing the format from [reload] to [reload HH:MM:SS].

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please describe):

Changes Made

  • Added ts() helper function that returns the current time via new Date().toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' })
  • Updated all console.log call prefixes in reload-extension.mjs from the static string [reload] to the dynamic template literal `[reload ${ts()}]`
  • Affected log messages: startup directory watch, extension reload start, reload success, missing reload button warning, extension not found warning, reload failure, connection error, process exit

Implementation Details

Key Changes:

  • apps/extension/scripts/reload-extension.mjs: Added ts() function (lines 17-19) and updated 9 console.log statements to embed the timestamp

Technical Notes:

  • ts() uses toLocaleTimeString with 'en-US' locale and hour12: false to ensure a consistent HH:MM:SS format regardless of the system locale
  • The change is purely additive to log output and does not affect any runtime logic or behavior

Testing

Testing Checklist

  • I have tested this code locally
  • All existing tests pass
  • I have added tests for new functionality
  • I have tested on the affected platform(s)

Manual Testing Steps

  1. Run the extension reload script (node apps/extension/scripts/reload-extension.mjs)
  2. Trigger a file change in the dist directory
  3. Verify that all log output now shows a timestamp in the [reload HH:MM:SS] format

Screenshots/Videos

N/A

Reviewer Checklist

  • Code follows the project's style guidelines
  • Changes are well-documented
  • No breaking changes or clearly documented if present
  • Security implications have been considered
  • Performance impact has been evaluated
  • All discussions have been resolved

Additional Notes

This change improves the debuggability of the extension reload script by making it easy to correlate log output with specific reload events when the watcher has been running for an extended period.

@timerring timerring self-assigned this Feb 21, 2026
@timerring timerring added the enhancement New feature or request label Feb 21, 2026
Copy link
Member Author

@timerring timerring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@timerring timerring merged commit ad2c47d into main Feb 21, 2026
@timerring timerring deleted the dev branch February 21, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant