paleolimbot commented on code in PR #35398:
URL: https://github.com/apache/arrow/pull/35398#discussion_r1220675006


##########
r/R/filesystem.R:
##########
@@ -384,7 +387,24 @@ S3FileSystem <- R6Class("S3FileSystem",
     region = function() fs___S3FileSystem__region(self)
   )
 )
-S3FileSystem$create <- function(anonymous = FALSE, ...) {
+S3FileSystem$create <- function(
+  anonymous = FALSE,
+  log_level = c("fatal", "error", "warn", "info", "debug", "trace", "off"),
+  ...) {
+  # Init S3 now only if log_level is set
+  # TODO: This is clunky

Review Comment:
   With apologies if we're sending you around in circles, I don't know if 
`S3Filesystem$create()` is the right place for this. Why not an 
`s3_initialize()` function? If somebody wants to set the logging level, they 
might do something like:
   
   ```r
   library(arrow)
   s3_initialize(log_level = "verbose")
   ```
   
   Alternatively, `options()` could be another somewhat idiomatic way to do 
this:
   
   ```r
   library(arrow)
   options(arrow.s3.log_level = "verbose")
   
   # ...first call to something S3-y would check 
getOption("arrow.s3.log_level") if
   # S3 hadn't been initialized yet.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to