Open cjyetman opened 2 years ago
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/
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.
Adapt the
write_log()
function so that it properly adapts to the result ofinteractive()
. Ifinteractive() == TRUE
, messages should be sent to the console so the user sees them immediately. Ifinteractive() == FALSE
, e.g. when running on TM website, messages should be sent to the appropriate log file. Then allwarning()
,print()
, and similar commands should be converted to usewrite_log()
instead.fyi @AlexAxthelm