Skip to content
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

chore(log): sync level and levelName in BaseHandler #4393

Merged
merged 5 commits into from
Feb 26, 2024

Conversation

timreichen
Copy link
Contributor

Changes

  • makes levelName a getter and setter so it stays in sync with level.
  • small cleanup with options in constructor().

Reasons

  • makes levelName and level should never get out of sync.
  • avoids || operator by setting default formatter value.

@kt3k
Copy link
Member

kt3k commented Feb 26, 2024

This looks like causing the regression in the performance when accessing to handler.levelName.

@timreichen
Copy link
Contributor Author

This looks like causing the regression in the performance when accessing to handler.levelName.

I changed it to store the current value in a private property. This should ensure synchronisation while keeping performance.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@kt3k kt3k merged commit 0f62d4c into denoland:main Feb 26, 2024
12 checks passed
@timreichen timreichen deleted the log_sync_level_and_levelName branch February 26, 2024 13:51
eryue0220 added a commit to eryue0220/deno_std that referenced this pull request Feb 28, 2024
…0/deno_std into fix/expect-custom-equality-case

* 'fix/expect-custom-equality-case' of github.com:eryue0220/deno_std: (63 commits)
  docs: link to `assertThrows()` and `assertRejects()` (denoland#4395)
  chore(log): sync `level` and `levelName` in BaseHandler (denoland#4393)
  docs: ignore bad snippet examples (denoland#4388)
  chore(media_types): format test names (denoland#4380)
  docs: clarify underscore guidance in README (denoland#4385)
  feat(collections): add `pick` and `omit` (denoland#4218)
  chore(msgpack): format test names (denoland#4381)
  refactor(encoding): prepare for `noUncheckedIndexedAccess` (denoland#4275)
  refactor(streams): prepare for `noUncheckedIndexedAccess` (denoland#4377)
  chore: fix .editorconfig syntax (denoland#4376)
  chore(semver): remove legacy `Range.ranges` object definition (denoland#4374)
  chore(semver): move breaking versions (denoland#4372)
  refactor(semver): rename `comparatorFormat()` to `formatComparator()` (denoland#4373)
  test(semver): add test for parse_range (denoland#4345)
  chore: use 'release' event for triggering jsr publish (denoland#4370)
  chore(http): fix spawned tests after migration script (denoland#4368)
  chore(crypto): move test scripts to own files (denoland#4367)
  0.217.0 (denoland#4369)
  build: update _ to - in workspace converter script (denoland#4357)
  chore(media_types): move `extensions` utility (denoland#4358)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants