Conversation
|
This looks nice! I'd suggest that logs are more appropriate for the state dir, falling back on the data dir though. https://docs.rs/directories/latest/directories/struct.ProjectDirs.html#method.state_dir https://specifications.freedesktop.org/basedir-spec/latest/index.html#variables |
|
If we were to use those locations, then on Windows it should go into the BUT, given that Julia generally has not adopted XDG at this point and has a standard log file location of The other question I have is how does this handle concurrency? Generally, we need a solution where multiple processes all write logs at the same time. This here doesn't seem to handle that scenario? And finally, this only adds the infrastructure, but never actually calls the init stuff, right? I think in general we probably want no logging by default but only opt into it via some configuration or something like that? |
|
I can't say I really see a downside of on-by-default logging, it could be nice to have a record of what versions are installed/uninstalled. How I wish Julia itself actually paid attention to platform standards instead of fighting them... |
|
Well, the really Windows native solution would be to use the platform logic infrastructure instead of log files. I'm pretty sure |

This PR adds the setup for logging using the
tracingmodule.After
init_loggingis called, a log file will be created in one of these locations (per XDG standard):or in a folder in the environment variable
JULIAUP_DATA_HOMEor in the current directory.tracing::info!ortracing::debug!can be used to log into the log file.Additionally,
RUST_LOGenvironment variable can be used to control the logs for the various modules or dependencies.