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

Implement removeHandler in std/logging module (fixes #23757) #24143

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

tocariimaa
Copy link
Contributor

Since the module allows for a handler to be added multiple times, for the sake of consistency, removeHandler only removes the first found instance of the handler in the handlers seq. So for n calls of addHandler using the same handler, n calls of removeHandler are required.

fixes #23757

lib/pure/logging.nim Outdated Show resolved Hide resolved
@Araq Araq merged commit d51d887 into nim-lang:devel Sep 20, 2024
19 checks passed
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from d51d887

Hint: mm: orc; opt: speed; options: -d:release
174460 lines; 8.121s; 653.977MiB peakmem

@tocariimaa tocariimaa deleted the stdlogging_removeHandler branch September 20, 2024 16:09
metagn pushed a commit to metagn/Nim that referenced this pull request Sep 21, 2024
nim-lang#24143)

Since the module allows for a handler to be added multiple times, for
the sake of consistency, `removeHandler` only removes the first found
instance of the handler in the `handlers` seq. So for n calls of
`addHandler` using the same handler, n calls of `removeHandler` are
required.

fixes nim-lang#23757

---------

Co-authored-by: Andreas Rumpf <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

in std/logging implement removeHandler
2 participants