-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use separate logger for ui/sw #217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review. updates incoming.
src/lib/logger.ts
Outdated
export const log = logObj | ||
export const error = logObj.error | ||
export const trace = logObj.trace | ||
const swLogPrefix = `helia:service-worker-gateway:sw:${host}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const swLogPrefix = `helia:service-worker-gateway:sw:${host}` | |
const swLogPrefix = `helia:sw-gateway:sw:${host}` |
Any thoughts on making the logs a little shorter since we use sw as an acception abbreviation elsewhere too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeaaa i thought about that. Theyre pretty long, so if you think shorter is fine im absolutely a fan.
I think uniqueness is the most important here, instead of verbosity. If someone is looking at these logs, theyre likely aware its a "service-worker-gateway"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "helia:gateway:sw" & "helia:gateway:ui" too obtuse?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice!
Title
fix: use separate logger for ui/sw
Description
Fixes #139
All logs now:
helia:service-worker-gateway:
helia:service-worker-gateway:ui
helia:service-worker-gateway:sw
Notes & open questions
On redirect page
filtering console logs by
helia:service-worker-gateway:sw
filtering console logs by
helia:service-worker-gateway:ui
Change checklist