Unexpected output when using `log_format` to disable normal logging
Describe the bug
When log_format = '-' is used to disable normal logging in direnv.toml, the following output is shown:
-
%!!(MISSING)(EXTRA string=loading ~/path/to/.envrc)
-
%!!(string=+UV_ACTIVE ~PATH ~VIRTUAL_ENV)(EXTRA string=export %!s(MISSING))
This seems like a bug, especially because the literal - is being output.
In this case, my .envrc contains:
layout uv
To Reproduce direnv.toml:
[global]
log_format = '-'
Expected behavior Logging output should be disabled.
Environment
- OS: macOS Sequoia
- Shell: fish
- Direnv version 2.36.0
Running into the same thing- this other issue has some good workarounds for the new behavior: https://github.com/direnv/direnv/issues/1418
It looks like you need both the DIRENV_LOG_FORMAT= in the env variables and the new direnv.toml configuration set to silence the output
Those instuctions seem incorrect and should probably be updated in the man page. Nothing in the code is acting upon the "-" sentinel value. The format string is processed as a Go fmt string without any further processing here.
In order to silence the status logs, one would theoretically need to set log_format = "", but that is currently being ignored.