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

Add option to output to stdout or stderr in AppenderConsole #62

Conversation

gadenbuie
Copy link
Contributor

The PR is motivated by trying to use lgr inside R Markdown documents, where it's generally better to send logging messages to stderr so they aren't captured in the document output.

This PR adds an output parameter to AppenderConsole$new() that is NULL by default but takes either "stdout" or "stderr". In the default case, the preference is for "stdout" unless running in a knitr rendering process (signaled by the knitr.in.progress option being TRUE). If a user really wants to output to stdout inside knitr, they can use AppenderConsole$new(output = "stdout").

@s-fleck
Copy link
Owner

s-fleck commented Feb 10, 2023

Thanks! I'll try to review it asap, looks good!

@s-fleck s-fleck changed the base branch from master to add-stdout-to-appenderconsole March 4, 2023 19:02
@s-fleck s-fleck merged commit d3f8a4b into s-fleck:add-stdout-to-appenderconsole Mar 4, 2023
@s-fleck
Copy link
Owner

s-fleck commented Mar 4, 2023

Hey sorry it took me a while. I reworked the feature to make it more flexible by allowing arbitrary connections as output for AppenderConsole, and some other adaptions to make it fit a bit better into the package.

s-fleck added a commit that referenced this pull request Mar 4, 2023
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.

2 participants