feat(utils/color): support cloudflare workers (edge)#3752
feat(utils/color): support cloudflare workers (edge)#3752EdamAme-x wants to merge 12 commits intohonojs:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3752 +/- ##
==========================================
+ Coverage 91.72% 91.73% +0.01%
==========================================
Files 159 159
Lines 10178 10180 +2
Branches 2896 2885 -11
==========================================
+ Hits 9336 9339 +3
+ Misses 841 840 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
|
After school, I will add tests for deno |
|
Hi @kingmesal. |
|
Hi @EdamAme-x Thank you for the PR. But I can't agree on this way using const app = new Hono<{
Bindings: {
NO_COLOR: boolean
}
}>()
app.use(async (c, next) => {
return logger(undefined, {
colorized: !c.env.NO_COLOR,
})
})But, I'm not sure it is best to add options for the second arg of |
|
We use But, I think we don't have the manner in Cloudflare Workers. |
|
I agree there is an option to add an opt |
|
@kingmesel |
|
My perspective is that the simpler and more consistent, the solution the better. I think if it were on the Passing in options is useful as it makes it pretty easy for people to find and alter the logger functionality, which I think is probably the better reason to use that approach over the |
|
I have created a PR to update the website with a tip on using the @kingmesal has noted that the default logging behaviour on CloudFlare Workers is to not have colored log output, which makes this PR unnecessary (sorry @EdamAme-x!). Note that the default behavior of the logger on CloudFlare Workers is different to Node/Bun/Deno, which default to colored status codes. |
|
okay, I will close this |
|
@StuartMoncrieff @EdamAme-x Thanks! |
Closes: #3751
The author should do the following, if applicable
bun run format:fix && bun run lint:fixto format the code