loggr icon indicating copy to clipboard operation
loggr copied to clipboard

Dots argument to log_file

Open richfitz opened this issue 10 years ago • 2 comments

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 avatar May 23 '15 02:05 richfitz

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

richfitz avatar May 23 '15 02:05 richfitz

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

smbache avatar May 23 '15 09:05 smbache