smbache / loggr

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

Dots argument to log_file #12

Open richfitz opened 9 years ago

richfitz commented 9 years ago

The dots argument to log_file induced a lot of repetition when generalising the interface. At the same time, I think it makes the package harder to use.

Writing:

log_file("mylog.log", INFO)

looks cool, but doesn't really add much more functionality than

log_file("mylog.log", "INFO")

and the latter has the advantage that it's easier to generate lists of subscriptions programmatically:

if (verbose) {
  subscriptions <- c("DEBUG", "INFO", "WARN", "ERROR", "CRITICAL")
} else {
  subscriptions <- c("WARN", "ERROR", "CRITICAL")
}
log_file("mylog.log", subscriptions)

I've added a subscriptions argument to allow this explicitly, but any interest in simplifying the interface?

richfitz commented 9 years ago

Also, sorry for the deluge - I have patchy internet access at the moment, so am operating in batch mode :grinning:

smbache commented 9 years ago

I guess you're right. One could even just accept vectors in ... and also get rid of your subscrition argument?