def test_stack_info(): alogging.STACK_INFO = True alogging.app_setup() slog = alogging.get_logger() def level_two(blip): slog.debug('some stuff, should include stack_info, blip=%s', blip) return blip def level_one(blip): slog.debug('alogging.STACK_INFO: %s', alogging.STACK_INFO) alogging.a(blip) return level_two(blip) resp = level_one('stuff') slog.debug('resp: %s', resp)
import logging import pprint import pytest import alogging from alogging.filters.pprint import PprintArgsFilter log = alogging.get_logger() @pytest.fixture def log_record(): _log_record = logging.makeLogRecord({ 'duration': 0.9, 'created': 1621620910.5428703, 'exc_info': None, 'exc_text': None, 'filename': 'module.py', 'funcName': 'noisy_method', 'levelname': 'DEBUG', 'levelno': 10, 'lineno':
def test_get_logger(): mlog = alogging.get_logger() log.debug('mlog: %s', mlog) mlog.debug('logging to test_alogging logger')