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

Severity level is contained twice in the log message row #63

Closed
aryoda opened this issue Jan 8, 2021 · 1 comment
Closed

Severity level is contained twice in the log message row #63

aryoda opened this issue Jan 8, 2021 · 1 comment
Labels

Comments

@aryoda
Copy link
Owner

aryoda commented Jan 8, 2021

Why is the severity level (here: "error") contained twice?

> library(tryCatchLog)
Using futile.logger for logging...
> tryCatchLog(stop("msg"))
ERROR [2021-01-08 18:58:30] [ERROR] msg

Compact call stack:
  1 tryCatchLog(stop("msg"))
...

This could be caused by futile logger...

@aryoda aryoda added the bug label Jan 8, 2021
@aryoda
Copy link
Owner Author

aryoda commented Jan 8, 2021

Analysis results:

The reason seems to be that

  • tryCatchLog includes the severity level in the function build.log.output
  • futile.logger as well as the internal logging function prepend the severity level too when a flog function is called
> flog.warn("msg")
WARN [2021-01-08 20:14:07] msg
> tryCatchLog:::log2console("WARN", "msg")
WARN [2021-01-08 20:19:06] msg

tryCatchLog should not include the severity level in the msg text itself but leave this to the logger function that corresponds to the severity level.

The bug was probably already introduced in commit 7c8e245 (Dec 3, 2017)!

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

No branches or pull requests

1 participant