-
Notifications
You must be signed in to change notification settings - Fork 878
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: browser respect child logger log level #1725
fix: browser respect child logger log level #1725
Conversation
I am still not sure if the approach I take actually goes into the right direction. Anyone has a guess here? |
Yes, I like this approach. |
437419c
to
ff199da
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
@mcollina I noticed that I used Furthermore, I am unsure how to proceed with the failing checks.
As for windows 16 and 18, I will try to figure out why this fails |
@mcollina I noticed that no new release is yet available that contains the fix. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pino](https://getpino.io) ([source](https://togithub.com/pinojs/pino)) | [`^8.14.1` -> `^8.14.2`](https://renovatebot.com/diffs/npm/pino/8.14.1/8.14.2) | [![age](https://developer.mend.io/api/mc/badges/age/npm/pino/8.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pino/8.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pino/8.14.1/8.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pino/8.14.1/8.14.2?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pinojs/pino (pino)</summary> ### [`v8.14.2`](https://togithub.com/pinojs/pino/releases/tag/v8.14.2) [Compare Source](https://togithub.com/pinojs/pino/compare/v8.14.1...v8.14.2) #### What's Changed - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.16.14 to 20.2.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1718](https://togithub.com/pinojs/pino/pull/1718) - build(deps-dev): bump rimraf from 4.4.1 to 5.0.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1719](https://togithub.com/pinojs/pino/pull/1719) - build(deps-dev): bump pino-pretty from 9.4.0 to 10.0.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1670](https://togithub.com/pinojs/pino/pull/1670) - docs: add pino-slack-webhook to list of v7+ compatible transports by [@​youngkiu](https://togithub.com/youngkiu) in [https://github.com/pinojs/pino/pull/1730](https://togithub.com/pinojs/pino/pull/1730) - Add missing closing curly brace in transports documentation by [@​JasoonS](https://togithub.com/JasoonS) in [https://github.com/pinojs/pino/pull/1737](https://togithub.com/pinojs/pino/pull/1737) - Issue [#​1735](https://togithub.com/pinojs/pino/issues/1735) - Programmatic Integration as a transport fails by [@​altearius](https://togithub.com/altearius) in [https://github.com/pinojs/pino/pull/1739](https://togithub.com/pinojs/pino/pull/1739) - build(deps-dev): bump typescript from 4.9.5 to 5.1.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1728](https://togithub.com/pinojs/pino/pull/1728) - build(deps-dev): bump bole from 4.0.1 to 5.0.5 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1734](https://togithub.com/pinojs/pino/pull/1734) - build(deps-dev): bump eslint-plugin-n from 15.7.0 to 16.0.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1740](https://togithub.com/pinojs/pino/pull/1740) - fix: browser respect child logger log level by [@​NicoVogel](https://togithub.com/NicoVogel) in [https://github.com/pinojs/pino/pull/1725](https://togithub.com/pinojs/pino/pull/1725) - Fix dependency version by [@​jsumners](https://togithub.com/jsumners) in [https://github.com/pinojs/pino/pull/1747](https://togithub.com/pinojs/pino/pull/1747) - fix: use `messageKey` when giving message precedence over error by [@​joelmukuthu](https://togithub.com/joelmukuthu) in [https://github.com/pinojs/pino/pull/1746](https://togithub.com/pinojs/pino/pull/1746) #### New Contributors - [@​youngkiu](https://togithub.com/youngkiu) made their first contribution in [https://github.com/pinojs/pino/pull/1730](https://togithub.com/pinojs/pino/pull/1730) - [@​JasoonS](https://togithub.com/JasoonS) made their first contribution in [https://github.com/pinojs/pino/pull/1737](https://togithub.com/pinojs/pino/pull/1737) - [@​altearius](https://togithub.com/altearius) made their first contribution in [https://github.com/pinojs/pino/pull/1739](https://togithub.com/pinojs/pino/pull/1739) - [@​NicoVogel](https://togithub.com/NicoVogel) made their first contribution in [https://github.com/pinojs/pino/pull/1725](https://togithub.com/pinojs/pino/pull/1725) - [@​joelmukuthu](https://togithub.com/joelmukuthu) made their first contribution in [https://github.com/pinojs/pino/pull/1746](https://togithub.com/pinojs/pino/pull/1746) **Full Changelog**: pinojs/pino@v8.14.1...v8.14.2 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/fwouts/previewjs). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4yNC4yIiwidXBkYXRlZEluVmVyIjoiMzYuMjQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pino](https://getpino.io) ([source](https://togithub.com/pinojs/pino)) | [`8.11.0` -> `8.15.0`](https://renovatebot.com/diffs/npm/pino/8.11.0/8.15.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/pino/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/pino/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/pino/8.11.0/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pino/8.11.0/8.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pinojs/pino (pino)</summary> ### [`v8.15.0`](https://togithub.com/pinojs/pino/releases/tag/v8.15.0) [Compare Source](https://togithub.com/pinojs/pino/compare/v8.14.2...v8.15.0) #### What's Changed - docs(transports): add axiom [#​1753](https://togithub.com/pinojs/pino/issues/1753) by [@​qlaffont](https://togithub.com/qlaffont) in [https://github.com/pinojs/pino/pull/1754](https://togithub.com/pinojs/pino/pull/1754) - Add pino-opentelemetry-transport as a known plugin to transports.md by [@​Vunovati](https://togithub.com/Vunovati) in [https://github.com/pinojs/pino/pull/1757](https://togithub.com/pinojs/pino/pull/1757) - fix: example code in transports.md by [@​exKAZUu](https://togithub.com/exKAZUu) in [https://github.com/pinojs/pino/pull/1761](https://togithub.com/pinojs/pino/pull/1761) - Add default levels to opts in multistream by [@​tzviki](https://togithub.com/tzviki) in [https://github.com/pinojs/pino/pull/1760](https://togithub.com/pinojs/pino/pull/1760) #### New Contributors - [@​qlaffont](https://togithub.com/qlaffont) made their first contribution in [https://github.com/pinojs/pino/pull/1754](https://togithub.com/pinojs/pino/pull/1754) - [@​Vunovati](https://togithub.com/Vunovati) made their first contribution in [https://github.com/pinojs/pino/pull/1757](https://togithub.com/pinojs/pino/pull/1757) - [@​exKAZUu](https://togithub.com/exKAZUu) made their first contribution in [https://github.com/pinojs/pino/pull/1761](https://togithub.com/pinojs/pino/pull/1761) - [@​tzviki](https://togithub.com/tzviki) made their first contribution in [https://github.com/pinojs/pino/pull/1760](https://togithub.com/pinojs/pino/pull/1760) **Full Changelog**: pinojs/pino@v8.14.2...v8.15.0 ### [`v8.14.2`](https://togithub.com/pinojs/pino/releases/tag/v8.14.2) [Compare Source](https://togithub.com/pinojs/pino/compare/v8.14.1...v8.14.2) #### What's Changed - build(deps-dev): bump [@​types/node](https://togithub.com/types/node) from 18.16.14 to 20.2.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1718](https://togithub.com/pinojs/pino/pull/1718) - build(deps-dev): bump rimraf from 4.4.1 to 5.0.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1719](https://togithub.com/pinojs/pino/pull/1719) - build(deps-dev): bump pino-pretty from 9.4.0 to 10.0.0 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1670](https://togithub.com/pinojs/pino/pull/1670) - docs: add pino-slack-webhook to list of v7+ compatible transports by [@​youngkiu](https://togithub.com/youngkiu) in [https://github.com/pinojs/pino/pull/1730](https://togithub.com/pinojs/pino/pull/1730) - Add missing closing curly brace in transports documentation by [@​JasoonS](https://togithub.com/JasoonS) in [https://github.com/pinojs/pino/pull/1737](https://togithub.com/pinojs/pino/pull/1737) - Issue [#​1735](https://togithub.com/pinojs/pino/issues/1735) - Programmatic Integration as a transport fails by [@​altearius](https://togithub.com/altearius) in [https://github.com/pinojs/pino/pull/1739](https://togithub.com/pinojs/pino/pull/1739) - build(deps-dev): bump typescript from 4.9.5 to 5.1.3 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1728](https://togithub.com/pinojs/pino/pull/1728) - build(deps-dev): bump bole from 4.0.1 to 5.0.5 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1734](https://togithub.com/pinojs/pino/pull/1734) - build(deps-dev): bump eslint-plugin-n from 15.7.0 to 16.0.1 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/pinojs/pino/pull/1740](https://togithub.com/pinojs/pino/pull/1740) - fix: browser respect child logger log level by [@​NicoVogel](https://togithub.com/NicoVogel) in [https://github.com/pinojs/pino/pull/1725](https://togithub.com/pinojs/pino/pull/1725) - Fix dependency version by [@​jsumners](https://togithub.com/jsumners) in [https://github.com/pinojs/pino/pull/1747](https://togithub.com/pinojs/pino/pull/1747) - fix: use `messageKey` when giving message precedence over error by [@​joelmukuthu](https://togithub.com/joelmukuthu) in [https://github.com/pinojs/pino/pull/1746](https://togithub.com/pinojs/pino/pull/1746) #### New Contributors - [@​youngkiu](https://togithub.com/youngkiu) made their first contribution in [https://github.com/pinojs/pino/pull/1730](https://togithub.com/pinojs/pino/pull/1730) - [@​JasoonS](https://togithub.com/JasoonS) made their first contribution in [https://github.com/pinojs/pino/pull/1737](https://togithub.com/pinojs/pino/pull/1737) - [@​altearius](https://togithub.com/altearius) made their first contribution in [https://github.com/pinojs/pino/pull/1739](https://togithub.com/pinojs/pino/pull/1739) - [@​NicoVogel](https://togithub.com/NicoVogel) made their first contribution in [https://github.com/pinojs/pino/pull/1725](https://togithub.com/pinojs/pino/pull/1725) - [@​joelmukuthu](https://togithub.com/joelmukuthu) made their first contribution in [https://github.com/pinojs/pino/pull/1746](https://togithub.com/pinojs/pino/pull/1746) **Full Changelog**: pinojs/pino@v8.14.1...v8.14.2 ### [`v8.14.1`](https://togithub.com/pinojs/pino/compare/v8.14.0...v8.14.1) [Compare Source](https://togithub.com/pinojs/pino/compare/v8.14.0...v8.14.1) ### [`v8.14.0`](https://togithub.com/pinojs/pino/compare/c1c8eb41240c0ae9282bac1741ae2ee7bdb82895...v8.14.0) [Compare Source](https://togithub.com/pinojs/pino/compare/c1c8eb41240c0ae9282bac1741ae2ee7bdb82895...v8.14.0) ### [`v8.12.1`](https://togithub.com/pinojs/pino/compare/v8.12.0...c1c8eb41240c0ae9282bac1741ae2ee7bdb82895) [Compare Source](https://togithub.com/pinojs/pino/compare/v8.12.0...c1c8eb41240c0ae9282bac1741ae2ee7bdb82895) ### [`v8.12.0`](https://togithub.com/pinojs/pino/compare/v8.11.0...v8.12.0) [Compare Source](https://togithub.com/pinojs/pino/compare/v8.11.0...v8.12.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 4pm on friday,before 9am on monday,every weekend" in timezone Europe/Paris, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/specfy/specfy). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMS4wIiwidXBkYXRlZEluVmVyIjoiMzYuMjcuMSIsInRhcmdldEJyYW5jaCI6ImNob3JlL3Jlbm92YXRlQmFzZUJyYW5jaCJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR addresses #960.
Goal of this PR:
Child level determines which logs of the child are logged.
Implementation before this PR
prototype
oflogger
contains the actual log functions which should be usedprototype
log functions are assigned to thelogger
whenever thesetLevel
function is callednoop
is assigned insteadWhat this PR changes
Symbol('pino.logFuncs')
Symbol('pino.hierarchy')
before this PR, it was handled via the prototype chain.
set
functions (for changing the log level)set
function is mainly responsible for defining the actual log functions that are usable, it felt like a logical step to also include the binding in it.bindings
property to each child that stores the bindings of the child.set
function.so, reassigning it only takes affect if the
level
is changed and then it only is updated for this one logger.Insights I want to share
There is a specific order in which a log is processed:
LOG
function is used to transform the arguments to the desired structure (can be found increateWrap
)Before this PR, the prototype chain was used the ensure that the bindings are prepended one after another.
Now they are collected once and then prepended at once.
Another improvement that comes with this PR as well is, that now in case of
noop
the logger actually does nothing.Before this PR, it always prepended the bindings and transformed the arguments no matter if the
noop
function was used or not.Finally, the base log functions are now only once defined in the
setupBaseLogFunctions
instead of in everyset
call.