Replies: 1 comment 2 replies
-
I haven't seen anybody caring about such logging, except for an occasional exception message being longer. But FWIW abusing |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With dynamic aspects of setup.py it is useful to see messages on (e.g.) discovery of libraries to compile modules. What is the best practice to show these messages?
I've been looking at setuptools/tests/test_logging.py for inspiration, but it only tests the internal logging. Could this logger be extended for other purposes? The standard logging module (now used by setuptools) is an obvious way, but it's not clear how it should be used.
Attempt 1
This attempt only shows "BEFORE setup()" from log threshold WARNING and higher before
setup()
and then for "MESSAGE TWO" either DEBUG or higher with--verbose
or INFO or higher without.Here it is with
--verbose
:Attempt 2
This uses non-public API and is a hack.
and now without
--verbose
:Analysis and expected behaviour
With both of the examples, the logger behaves as expected after
setup()
, as it has set the appropriate log level based on the presence (or absence) of a verbose flag. However, these messages are used to show messages gathering data beforesetup()
. Neither of the above two attempts show messages for the appropriate logger level. Is there a better way?And as a bonus question, why does the placement order of
--verbose
matter? E.g.python setup.py sdist --verbose
ignores the verbose flag.Beta Was this translation helpful? Give feedback.
All reactions