air icon indicating copy to clipboard operation
air copied to clipboard

How to suppress stdout from 'air'?

Open jsfag opened this issue 4 years ago • 7 comments

It's freaking annoying:

image

jsfag avatar Oct 27 '21 18:10 jsfag

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.

bartek avatar Oct 27 '21 23:10 bartek

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.

silverwind avatar Nov 17 '21 09:11 silverwind

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?

ThomasJanUta avatar Apr 05 '22 10:04 ThomasJanUta

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".

silverwind avatar Apr 05 '22 12:04 silverwind