smbache / loggr

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

Ordering of log levels? #25

Open bhmevik opened 8 years ago

bhmevik commented 8 years ago

I really like the fact that this package captures messages from message(), warning() and stop(). IMO it is a potential killer feature.

However, I miss a simple way to specify that "I want to log all messages of level INFO or higher", etc. As I understand it, currently, one has to specify all levels explicitly in the log_file() call. It would be very useful if the levels were ordered, for instance DEBUG > INFO > (SIMPLE)MESSAGE > WARN = SIMPLEWARNING > ERROR > SIMPLEERROR = CRITICAL. Other logging systems I've seen do this by assigning a numerical value to each symbolic log level, and then test for >= num_log_level. Would it be possible to implement something like this in loggr? I think it would be very useful, and it would also make it easy to add custom log levels.

smbache commented 8 years ago

Good point.