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

canonical way to remove an appender #149

Closed
r2evans opened this issue Mar 2, 2024 · 3 comments
Closed

canonical way to remove an appender #149

r2evans opened this issue Mar 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@r2evans
Copy link

r2evans commented Mar 2, 2024

Sorry to bug you, but I can't find this in the docs ...

I have a long-running process that always logs to the console (appender_console) but occasionally jumped into some new subdirectory and I'd like it to be able to temporarily append (also) to a logfile in that subdirectory. Once that subdir's task is complete, I'd like to no longer append to that file (and never return to it).

I can add multiple appenders without problem, but without breaking into the internal namespaces environment, I don't know how to remove an appender completely.

Thoughts?

log_appender(appender_console)
log_info("normal")
log_appender(appender_file(somefile), index=2)
log_info("temporary") # goes to both the console and the file
log_appender(**DELETE**, index=2)
log_info("console only")
@r2evans r2evans added the bug Something isn't working label Mar 2, 2024
@daroczig
Copy link
Owner

daroczig commented Mar 2, 2024

This is actually something (I think) I've just pushed yesterday to your branch in #133 :)

f01b976

PS: if that PR looks good, I'll go ahead and merge all these and start testing for a CRAN release.

@r2evans
Copy link
Author

r2evans commented Mar 2, 2024

Haha! Great minds think alike (I'm being presumptuous that I'm at least half as smart as you :-)

@r2evans r2evans closed this as completed Mar 2, 2024
@daroczig
Copy link
Owner

daroczig commented Mar 3, 2024

lol 😂

agreed on the great minds think alike part, but if I was that smart .. I should have gone through all your awesome ideas and PRs years ago!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants