daroczig/logger

activating `log_errors()` multiple times returns multiple lines of same error log

Closed this issue · 2 comments

Hi,
just came across that activating log_errors() multiple time multiplies the error messages.

log_errors()
log_failure(stopifnot(1 ==2))
ERROR [2022-06-17 07:28:47] 1 == 2 is not TRUE
ERROR [2022-06-17 07:28:47] 1 == 2 is not TRUE
Error: 1 == 2 is not TRUE
log_errors()
log_failure(stopifnot(1 ==2))
ERROR [2022-06-17 07:29:07] 1 == 2 is not TRUE
ERROR [2022-06-17 07:29:07] 1 == 2 is not TRUE
ERROR [2022-06-17 07:29:07] 1 == 2 is not TRUE
Error: 1 == 2 is not TRUE
log_errors()
log_failure(stopifnot(1 ==2))
ERROR [2022-06-17 07:29:17] 1 == 2 is not TRUE
ERROR [2022-06-17 07:29:17] 1 == 2 is not TRUE
ERROR [2022-06-17 07:29:17] 1 == 2 is not TRUE
ERROR [2022-06-17 07:29:17] 1 == 2 is not TRUE
Error: 1 == 2 is not TRUE

Hello,

Just wanted to let @daroczig know that even when you run the same script (e.g. starting a shiny app), it leads to multiple lines.

Are there any workarounds?

Sorry for the long delay with getting back on this 😞
Thanks for the report! This seems to be a duplicate of #88, which was fixed a couple of months ago, so closing this. Please reopen if you see otherwise.