Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

adapt write_log() so that it adapts to interactive or not #581

Open
cjyetman opened this issue Dec 30, 2021 · 2 comments
Open

adapt write_log() so that it adapts to interactive or not #581

cjyetman opened this issue Dec 30, 2021 · 2 comments
Assignees

Comments

@cjyetman
Copy link
Member

cjyetman commented Dec 30, 2021

Adapt the write_log() function so that it properly adapts to the result of interactive(). If interactive() == TRUE, messages should be sent to the console so the user sees them immediately. If interactive() == FALSE, e.g. when running on TM website, messages should be sent to the appropriate log file. Then all warning(), print(), and similar commands should be converted to use write_log() instead.

fyi @AlexAxthelm

@cjyetman cjyetman self-assigned this Dec 30, 2021
@AlexAxthelm
Copy link
Contributor

we might want to consider moving to an actual logging package.

There's a good list in the README for https://github.com/daroczig/logger/

@cjyetman
Copy link
Member Author

I'm very hesitant to add any new dependencies unless there's an extremely good reason and the needed utility can not be easily achieved without it. I just went through an enormous amount of work pruning as many dependencies as possible. It makes a significant difference especially in the build time, run time, test time, file size, maintenance, etc. of the docker image for TM.

See https://www.tinyverse.org for some explanation of why one may want to avoid unnecessary dependencies, and https://www.tidyverse.org/blog/2019/05/itdepends/ for a slightly less hostile version of the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants