loggr icon indicating copy to clipboard operation
loggr copied to clipboard

Cannot open file [...] No such file or directory

Open abeburnett opened this issue 8 years ago • 2 comments

Hi there,

Love the simple logging utility for R. Say, I'm currently getting a weird error--weird because I can see loggr create the log file, and I can see it writing to the log file. Yet, I'm seeing constant warning messages in the console (very annoying!) which say that it cannot open the log file and that there's no such file or directory. Clearly it can open the file because it is opening the file and writing to it.

Thoughts?

library(loggr)
# setup logging
log_file(paste0("logs/gravity_well_",Sys.Date(),".log"), overwrite = FALSE)
> log_debug("HELLO")
Warning message:
In file(file, ifelse(append, "a", "w")) :
  cannot open file '/logs/gravity_well_2017-04-06.log': No such file or directory

File permissions are: -rw-r--r-- 1 abe-burnett abe-burnett 371 Apr 6 21:29 gravity_well_2017-04-06.log

abeburnett avatar Apr 06 '17 21:04 abeburnett

https://www.dropbox.com/s/xadzbv1mm3qgg2c/Screenshot%202017-04-06%2015.34.01.png?dl=0

abeburnett avatar Apr 06 '17 21:04 abeburnett

Sounds weird and a bit hard to reproduce. Could you debug the file function to step through what happens?

smbache avatar Apr 06 '17 21:04 smbache