Conversation
This will allow to disable different warnings individually.
Also show the warning number associated with the warning when outputting it to let the users know which warning do they need to disable if they don't want to see some message.
Having a class for scope is not very pythonic either. Why not use the
Agreed about
Yes, I think it's the better approach — it makes the command line human-readable and makes it possible to enable warnings in a nice way too, should we decide to do that in the future. I'd also append
It's documented by means of the |
I'm not happy with this, importing both
warningandWARNis redundant, but I don't know how to avoid it. I'm also not sure if there is no some better way to selectively suppress and annotate the log messages, Python logging module is mind bogglingly complex and horribly documented, so I'm completely lost in it.Please let me know if you can see how to do it better.
But at least this does seem to work...
I just realized that another possibility might be to use gcc-like approach and use warning names instead of numbers, e.g.
-Wno-unused-varsinstead of the current-w 102. Would you prefer to do it like this?Also, I guess this needs to be documented, but the command line tool doesn't seem to be documented at all right now, or am I missing something?