8go / matrix-commander

simple but convenient CLI-based Matrix client app for sending and receiving
GNU General Public License v3.0
563 stars 59 forks source link

"--log-level" not correctly forwarded to nio library #148

Closed ManOrs88 closed 12 months ago

ManOrs88 commented 1 year ago

hello,

with latest matrix-nio release (seen on 0.21.2, not sure since when the behavior it's present), the log level set from matrix-commander cli appears to be ignored, nio messages always are at INFO level

this generates some clutter if you have an automated script and only want warnings and up, or if you want more debug messages, as in both cases you get "info" level from nio

regards, manuel

0ranki commented 1 year ago

matrix-nio 0.20.0 works as it should

0x766C70 commented 12 months ago

same here with Version: 0.22.0

8go commented 12 months ago

Thank you @0ranki and @0x766C70 for chiming in here.

8go commented 12 months ago

I tested the following:

Python 3.11 and matrix-nio 0.22.0 on Linux

Python 3.11 and matrix-nio 0.22.1 on Linux

matrix-commander -m test --log-level INFO DEBUG
matrix-commander -m test --log-level INFO INFO
matrix-commander -m test --log-level INFO WARNING

All is working correctly. I cannot reproduce your (bad) behavior with matrix-nio 0.22.*. I suggest you upgrade to matrix-nio 0.22.1. If you can re-produce the error there re-open the issue.

ManOrs88 commented 12 months ago

hello @8go ,

with your syntax it is working as expected, I was not specifying both log levels, only the first one, so it was an error on my side

I'm not sure why it was behaving differently before my initial report, maybe matrix-nio was not emitting those info level messages

thanks a lot for the help, manuel

8go commented 11 months ago

But yes, matrix-nio now prints more information on level INFO, so running the same mc command as before might result in more debug output. That's because martix-nio has changed. To avoid this use e.g. --log-level INFO WARNING or similar.