-
-
Notifications
You must be signed in to change notification settings - Fork 702
feat(logger): support for NO_COLOR
on cloudflare workers
#4094
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
base: main
Are you sure you want to change the base?
feat(logger): support for NO_COLOR
on cloudflare workers
#4094
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4094 +/- ##
==========================================
+ Coverage 91.29% 91.33% +0.04%
==========================================
Files 168 168
Lines 10766 10704 -62
Branches 3040 3052 +12
==========================================
- Hits 9829 9777 -52
+ Misses 936 926 -10
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I also have another plan, #4095. |
If it's ready to review, please ping me:) |
9d25f4c
to
d036a85
Compare
Old Cloudflare workers are missing import('cloudflare:workers')
@yusukebe This is now ready for review. |
ab269b1
to
4a2e1c1
Compare
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.
LGTM!
Thanks @ryuapp ! I'll merge this later and include the next minor release (maybe shipped soon). |
closes #3751
Note
Currently,
process.env
is available on Cloudflare Workers withnodejs_compat
flag, so there may not be a need to support it.https://developers.cloudflare.com/workers/runtime-apis/nodejs/process/#processenv
Logger now uses
getColorEnabledAsync()
to support retrieving cloudflare env. Since we couldn't support this without dynamic import now, I created a newgetColorEnabled()
that is asynchronous.getColorEnabled()
is maintained for backwards compatibility forshowRoute()
.The cost of dynamic imports has not been investigated, so it may be necessary to optimize it with following PR:
The author should do the following, if applicable
bun run format:fix && bun run lint:fix
to format the code