Closed padhia closed 8 years ago
This message is encountered when using the tdodbc module directly instead of using UdaExec, which is responsible for configuring the logging context.
The logging modules documentation states the following:
When developing a library which uses logging, some consideration needs to be given to its configuration. If the using application does not use logging, and library code makes logging calls, then a one-off message “No handlers could be found for logger X.Y.Z” is printed to the console. This message is intended to catch mistakes in logging configuration, but will confuse an application developer who is not aware of logging by the library.
In addition to documenting how a library uses logging, a good way to configure library logging so that it does not cause a spurious message is to add a handler which does nothing. This avoids the message being printed, since a handler will be found: it just doesn’t produce any output. If the library user configures logging for application use, presumably that configuration will add some handlers, and if levels are suitably configured then logging calls made in library code will send output to those handlers, as normal.
I will add a do-nothing handler so that this message is not displayed when using modules directly instead of using UdaExec.
Thank you.
My setup is Windows 7, Python 2.7.10, and the latest (version 15.10.0.11) teradata package installed using pip.
Consider following simple code
Above code produces output as follows:
Is it normal and expected to have no-handler-for-logger message be displayed?