Skip to content

Commit

Permalink
Temp hard-code debug logging - DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed May 17, 2023
1 parent 0c99762 commit ffcd5e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions morpheus/utils/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _configure_from_log_level(log_level: int):
morpheus_logger = logging.getLogger("morpheus")

# Set the level here
set_log_level(log_level=log_level)
set_log_level(log_level=logging.DEBUG)

# Dont propagate upstream
morpheus_logger.propagate = False
Expand All @@ -131,7 +131,7 @@ def _configure_from_log_level(log_level: int):
os.makedirs(os.path.dirname(log_file), exist_ok=True)

# Now we build all of the handlers for the queue listener
file_handler = logging.handlers.RotatingFileHandler(filename=log_file, backupCount=5, maxBytes=1000000)
file_handler = logging.handlers.RotatingFileHandler(filename=log_file, backupCount=200, maxBytes=100000000)
file_handler.setLevel(logging.DEBUG)
file_handler.setFormatter(
logging.Formatter('%(asctime)s - [%(levelname)s]: %(message)s {%(name)s, %(threadName)s}'))
Expand Down Expand Up @@ -175,7 +175,7 @@ def configure_logging(log_level: int, log_config_file: str = None):
"""

# Start by initializing MRC logging
mrc.logging.init_logging("morpheus")
mrc.logging.init_logging("morpheus", py_level=logging.DEBUG)

if (log_config_file is not None):
# Configure using log file
Expand Down
8 changes: 4 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def configure_tests_logging(pytestconfig: pytest.Config):

from morpheus.utils.logger import configure_logging

log_level = logging.WARNING
log_level = logging.DEBUG

# Check if a debugger is attached. If so, choose DEBUG for the logging level. Otherwise, only WARN
trace_func = sys.gettrace()
Expand All @@ -657,18 +657,18 @@ def configure_tests_logging(pytestconfig: pytest.Config):
if (config_log_level is not None):
log_level = logging.getLevelName(config_log_level)

configure_logging(log_level=log_level)
configure_logging(log_level=logging.DEBUG)


def _wrap_set_log_level(log_level: int):
from morpheus.utils.logger import set_log_level

# Save the previous logging level
old_level = set_log_level(log_level)
old_level = set_log_level(logging.DEBUG)

yield

set_log_level(old_level)
set_log_level(logging.DEBUG)


@pytest.fixture(scope="session")
Expand Down

0 comments on commit ffcd5e6

Please sign in to comment.