[logtools] do not use the root logger
Currently Bliss adds 2 handlers to the root logger logging.getLogger()
for output to beacon and the user (REPL). This affects everyone that uses Bliss as a library, because all loggers have the root logger as parent (also the loggers of the external tools). It would be better to use logging.getLogger("bliss")
for this instead of the root logger. However this requires all loggers to be instantiated like this:
logger = logging.getLogger(__name__)
which is the standard way of doing things. Or at least do
logger = logging.getLogger("bliss.{}".format(...))
so that logging.getLogger("bliss")
is the parent and we can add the 2 handlers there instead of the root logger.
However there are plenty of places that instantiate loggers as follows:
bliss/__init__.py: logging.getLogger("global").setLevel(log_level)
bliss/__init__.py: logging.getLogger("bliss").setLevel(log_level)
bliss/__init__.py: logging.getLogger("flint").setLevel(log_level)
bliss/config/conductor/log_server.py:_log = logging.getLogger("log_server")
bliss/config/conductor/server.py:_log = logging.getLogger("beacon")
bliss/controllers/flex.py:flex_logger = logging.getLogger("flex")
bliss/controllers/correlator/flex/server.py:log = logging.getLogger("FlexServer")
...
As a result these loggers do not have logging.getLogger("bliss")
as a parent. In fact they only have the root logger as parent.