def test_set_logging_level(): assert logging.getLogger('system').getEffectiveLevel() == logging.WARNING micropsi.set_logging_levels({ 'system': 'DEBUG', 'world': 'DEBUG', 'agent': 'DEBUG' }) assert logging.getLogger('system').getEffectiveLevel() == logging.DEBUG assert logging.getLogger('world').getEffectiveLevel() == logging.DEBUG assert micropsi.cfg['logging']['level_agent'] == 'DEBUG'
def test_get_logger_messages(): msg = "Attention passengers. The next redline train to braintree is now arriving!" micropsi.set_logging_levels(system='INFO') logging.getLogger('system').info(msg) res = micropsi.get_logger_messages('system') assert len(res['logs']) == 1 assert res['logs'][0]['msg'] assert res['logs'][0]['logger'] == 'system' assert res['logs'][0]['level'] == 'INFO' assert 'time' in res['logs'][0]
def test_get_logger_messages(): msg = "Attention passengers. The next redline train to braintree is now arriving!" micropsi.set_logging_levels({'system': 'INFO'}) logging.getLogger('system').info(msg) res = micropsi.get_logger_messages('system') item = res['logs'][-1] assert item['msg'] assert item['logger'] == 'system' assert item['level'] == 'INFO' assert 'time' in item assert item['step'] is None
def set_logging_levels(logging_levels): runtime.set_logging_levels(logging_levels) return True
def set_logging_levels(system=None, world=None, nodenet=None): runtime.set_logging_levels(system, world, nodenet) return True
def set_logging_levels(system=None, world=None, nodenet=None): runtime.set_logging_levels(system, world, nodenet) return dict(status="success")
def test_set_logging_level(): assert logging.getLogger('system').getEffectiveLevel() == logging.WARNING micropsi.set_logging_levels(system='DEBUG', world='DEBUG', nodenet='DEBUG') assert logging.getLogger('system').getEffectiveLevel() == logging.DEBUG assert logging.getLogger('world').getEffectiveLevel() == logging.DEBUG assert logging.getLogger('nodenet').getEffectiveLevel() == logging.DEBUG
def set_logging_levels(logging_levels): """ Set the logging levels """ runtime.set_logging_levels(logging_levels) return True
def test_set_logging_level(): assert logging.getLogger('system').getEffectiveLevel() == logging.WARNING micropsi.set_logging_levels({'system': 'DEBUG', 'world': 'DEBUG', 'agent': 'DEBUG'}) assert logging.getLogger('system').getEffectiveLevel() == logging.DEBUG assert logging.getLogger('world').getEffectiveLevel() == logging.DEBUG assert micropsi.cfg['logging']['level_agent'] == 'DEBUG'