Closed abertschi closed 7 years ago
Maybe you could introduce a --verbose [LEVEL]
flag instead of --trace
and --debug
, where one can specify the level of verbosity/amount of debug information, e.g.
Level 0 : only errors and success messages (standard) Level 1 : level 0 + debug Level 2 : level 1 + trace
Edit: damn, didn't want to close the issue :sob:
Maybe you could introduce a --verbose [LEVEL] flag instead of --trace and --debug, where one can specify the level of verbosity/amount of debug information, e.g.
Indeed, that's what I was planning to do :)
Regarding your commit, it seems a bit odd that one has to configure the logging module before other imports. It's fine as it works, but I wouldn't say that this is best practice ;) (the "issue" is the postcard_creator module, see Configuring Logging for a Library).
Oh and the get_logger
method (Line 268) is dead code.
but otherwise :+1:
Thanks for looking at this. 👍
Regarding your commit, it seems a bit odd that one has to configure the logging module before other imports. It's fine as it works, but I wouldn't say that this is best practice ;) (the "issue" is the postcard_creator module, see Configuring Logging for a Library).
You are right, I fixed these "issues" yesterday in the api wrapper I probably will change the import order once the api wrapper is working and the new changes uploaded to pip.
Oh and the get_logger method (Line 268) is dead code.
get_logger
is meant for plugins. So, no. I probably should comment this tho :)
But as the plugins inherit from Postcards
, they can access self.logger
. There is no need for a getter function?
I am aware that the getter method is optional. The only reason I wrote it was to be consistent in having only methods in the plugin API. I feel rather indifferent towards keeping it or not though.
As described in #2 branch: https://github.com/abertschi/postcards/compare/master...feature/logging