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) Throttle logging of deprecation messages #3069

Closed
joshgoebel opened this issue Mar 23, 2021 · 4 comments · Fixed by #3092
Closed

(chore) Throttle logging of deprecation messages #3069

joshgoebel opened this issue Mar 23, 2021 · 4 comments · Fixed by #3092
Labels
enhancement An enhancement or new feature good first issue Should be easier for first time contributors help welcome Could use help from community
Milestone

Comments

@joshgoebel
Copy link
Member

Would it maybe make sense to throttle logging the same deprecation messages? We're using highlight.js as a dependency of another dependency so can't directly update the deprecated code. The console is simply drowned in the exactly same deprecation message. Once would suffice, IMO, so we could alert the dependency to change it.

Originally posted by @mihkeleidast in #2277 (comment)

@allejo
Copy link
Member

allejo commented Mar 24, 2021

👍 for throttling deprecation messages. I would imagine it'd cause havoc on the hljs website if it weren't using highlightAll() for example (probably logging a deprecation message ~190 times).

@joshgoebel
Copy link
Member Author

@mihkeleidast Would you want to contribute a small PR against our logger code to this effect?

@joshgoebel joshgoebel added enhancement An enhancement or new feature good first issue Should be easier for first time contributors help welcome Could use help from community labels Mar 25, 2021
@joshgoebel joshgoebel changed the title Consider: Throttle logging of deprecation messages (chore) Throttle logging of deprecation messages Mar 25, 2021
@joshgoebel joshgoebel added this to the 11.0 milestone Mar 26, 2021
@joshgoebel joshgoebel mentioned this issue Mar 27, 2021
25 tasks
@mihkeleidast
Copy link
Contributor

I'll try to come up with something :)

@joshgoebel
Copy link
Member Author

I'd just use a simple object literal keyed on the message and and version.

seenDeprecations[`${version}-${msg}`] = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature good first issue Should be easier for first time contributors help welcome Could use help from community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants