smbache / loggr

Easy and flexible logging for R
Other
79 stars 6 forks source link

Prevent duplication of messages and warnings? #27

Open DarwinAwardWinner opened 7 years ago

DarwinAwardWinner commented 7 years ago

I like the simplicity of this package, and would like to use it just to add timestamps to my messages and warnings. However, it seems that the timestamped messages appear in addition to the normal ones rather then replacing them. Is there any way to fix this?

> library(loggr)
> log_file("console")
2017-03-17 11:15:51.149 - DEBUG - Activating logging to console
> message("This appears twice")
2017-03-17 11:22:56.405 - SIMPLEMESSAGE - This appears twice
This appears twice

(Obviously I could just replace message with log_info, etc., but I can't do that in other packages' code that uses message.)