Note It is strongly advised that you do not add any handlers other than NullHandler to your library’s loggers. This is because the configuration of handlers is the prerogative of the application developer who uses your library. The application developer knows their target audience and what handlers are most appropriate for their application: if you add handlers ‘under the hood’, you might well interfere with their ability to carry out unit tests and deliver logs which suit their requirements.
Using the root logger will call basicConfig and subsequently add handlers to the root logger which is undesirable for an application developer who wants to control the logging for their requirements.
Isn't use of the root logger bad practice? I'll quote the Python documentation for libraries (https://docs.python.org/3/howto/logging.html#configuring-logging-for-a-library)
Using the root logger will call basicConfig and subsequently add handlers to the root logger which is undesirable for an application developer who wants to control the logging for their requirements.