faust-streaming / faust

Python Stream Processing. A Faust fork
https://faust-streaming.github.io/faust/
Other
1.65k stars 183 forks source link

How do I set the log level when using the faust CLI? #99

Closed pmantica1 closed 2 years ago

pmantica1 commented 3 years ago

Sorry for asking this question here since it is probably not the right place but how do I set the log level when running a faust CLI command?

This is a duplicate of: https://github.com/robinhood/faust/issues/703

gdub commented 3 years ago

The top-level faust command accepts an option to set log level:

$ faust --help
Usage: faust [OPTIONS] COMMAND [ARGS]...
[snip]
Options:
[snip]
  -l, --loglevel [crit|error|warn|info|debug]
                                  Logging level to use.  [default: WARN]

Example:

$ faust -l debug -A myapp agents
[2021-02-24 21:54:21,055] [3149389] [INFO] [^Worker]: Starting... 
[2021-02-24 21:54:21,055] [3149389] [DEBUG] [^-agents]: Starting... 
┌Agents────┬───────┬───────┐
│ name     │ topic │ help  │
├──────────┼───────┼───────┤
│ @consume │ demo  │ <N/A> │
└──────────┴───────┴───────┘
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^-agents]: Started. 
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^Worker]: Started. 
[2021-02-24 21:54:21,057] [3149389] [INFO] [^Worker]: Stopping... 
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^-agents]: Stopping... 
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^-agents]: Shutting down... 
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^-agents]: -Stopped! 
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^Worker]: Shutting down... 
[2021-02-24 21:54:21,057] [3149389] [DEBUG] [^Worker]: -Stopped! 
[2021-02-24 21:54:21,058] [3149389] [INFO] [^Worker]: Gathering service tasks... 
[2021-02-24 21:54:21,058] [3149389] [INFO] [^Worker]: Gathering all futures... 
[2021-02-24 21:54:22,059] [3149389] [INFO] [^Worker]: Closing event loop