예제 #1
0
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'
예제 #2
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')
    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]
예제 #3
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
예제 #4
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
예제 #5
0
def set_logging_levels(logging_levels):
    runtime.set_logging_levels(logging_levels)
    return True
예제 #6
0
def set_logging_levels(system=None, world=None, nodenet=None):
    runtime.set_logging_levels(system, world, nodenet)
    return True
예제 #7
0
def set_logging_levels(system=None, world=None, nodenet=None):
    runtime.set_logging_levels(system, world, nodenet)
    return dict(status="success")
예제 #8
0
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
예제 #9
0
def set_logging_levels(logging_levels):
    """ Set the logging levels """
    runtime.set_logging_levels(logging_levels)
    return True
예제 #10
0
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'