daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
285 stars 42 forks source link

.topenv cannot be supplied to log_info() #140

Closed MichaelChirico closed 7 months ago

MichaelChirico commented 7 months ago
log_info("...", .topenv = .GlobalEnv)
# Error in log_level(INFO, ..., .logcall = sys.call(), .topcall = sys.call(-1),  : 
#   formal argument ".topenv" matched by multiple actual arguments

This looks to be WAI based on the documentation of ..., but still threw me off. Maybe a friendlier error here? Perhaps if there are any named arguments to ...?

daroczig commented 7 months ago

the proper solution might be introducing .topenv and the other similar args for the log_info etc helpers, continuing passing the higher-level frame down. I'd highly appreciate a PR, otherwise I'll try to get this in a couple of weeks