You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
right now the docs suggest adding this to the __init__.py for a logmuse-enabled package:
import logmuse
logmuse.init_logger(PACKAGE)
Ostensibly, this does thsi: "Now it will be set up with default parameters for your within-python-use. "
However, in my hands, this is making it so that for a package that does this, its logger is not inheriting the formatter from a root logger.
the example is, I'm trying to test bbconf interactively, like this:
from bbconf import BedBaseConf
import logging
import sys
def set_up_interactive_logger(package=None) -> logging.Logger:
"""Set up a logger for interactive testing"""
_LOGGER = logging.getLogger(package)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
stream = logging.StreamHandler(sys.stdout)
stream.setFormatter(formatter)
stream.setLevel(logging.DEBUG)
_LOGGER.addHandler(stream)
_LOGGER.setLevel(logging.DEBUG)
return _LOGGER
_LOGGER = set_up_interactive_logger()
_LOGGER.debug("Test log message")
bbc = BedBaseConf("../bedbase.org/config/bedbase.yaml")
So _LOGGER is a root logger. but when I instantiate BedBaseConf, then bbconf is correctly using this formatter, but the pipestat logger is ignoring it.
If I remove the call to logmuse. init_logger from pipestat.__init__.py, then it works correctly.
So I think the recommendation in the docs is actually breaking things and I'm not sure what the solution is.
The text was updated successfully, but these errors were encountered:
Sorry for the noise - I deleted my last comment because it turns out that the issue is elsewhere. Nevertheless, I think this might be related to what we are working on, namely redirecting stderr / stdout to a io.StringIO stream in our HTTP API That only works if we remove the call to init_logger() in looper.__init__.py and explicitly specify stream=sys.stderr in the call to logmuse.logger_via_cli().
right now the docs suggest adding this to the
__init__.py
for a logmuse-enabled package:Ostensibly, this does thsi: "Now it will be set up with default parameters for your within-python-use. "
However, in my hands, this is making it so that for a package that does this, its logger is not inheriting the formatter from a root logger.
the example is, I'm trying to test bbconf interactively, like this:
So
_LOGGER
is a root logger. but when I instantiateBedBaseConf
, thenbbconf
is correctly using this formatter, but thepipestat
logger is ignoring it.If I remove the call to
logmuse. init_logger
frompipestat.__init__.py
, then it works correctly.So I think the recommendation in the docs is actually breaking things and I'm not sure what the solution is.
The text was updated successfully, but these errors were encountered: