Open jsfag opened 3 years ago
I don't believe there's a way to suppress the logging in any global way, except increase it (via -d
debug mode)
The logging configuration is limited to adding time and in tracing the calls to the logger (example starting point), there doesn't seem to be any checks around configuration for writing each line.
It seems like a good configuration that could exist in the toml file and be used when initializing the logger.
It'd be nice to be able to selectively suppress stuff like the watching <something>
lines. On big projects, it spams the terminal with hundrets of useless lines which is rather annoying.
I just started using air. Installing, configuring, running air is great except that you get blasted with noise:
__ _ ___
/ /\ | | | |_)
/_/--\ |_| |_| \_ , built with Go
watching .
watching __pycache__
watching __pycache__
!exclude log
!exclude log
!exclude pkg
watching py
watching py
watching py\__pycache__
watching py\__pycache__
watching py\__pycache__
watching py\secret
watching py\secret
watching py\secret
watching py\util
watching py\util
watching py\util
watching py\util\__pycache__
watching py\util\__pycache__
watching py\util\__pycache__
watching py\util\__pycache__
!exclude res
!exclude res
watching src
watching src\config
watching src\secret
watching src\exec
watching src\http
watching src\util
building...
running...
This is all useless including the duplicated paths. I know that I am using AIR, I know how the project looks like.
Adding some kind of silent mode in the configuration would work wonders:
[log]
time = false
silent = true # enable silent mode for air-related logs but keep the logging from my application
@xiantang @cosmtrek Could you comment where in the code you would inject an "escape" or flag for silencing the stoud?
Maybe log levels could be introduced. I'd classify the above "watching" and "exclude" stuff as "debug", for example. "building" and "running" is probably "info".
https://github.com/air-verse/air/pull/367 does solve this for me personally.
__ _ ___
/ /\ | | | |_)
/_/--\ |_| |_| \_ v1.52.3, built with Go go1.22.4
@brettinternet i have put in #641 that allows a separate flag "silent" that suppresses the version info and the notifications about files being watched/refreshing, so the only output you get is from your app.
It's freaking annoying: