Exemple #1
0
def case1():
    lagan.load()
    lagan.set_filter_level(lagan.LEVEL_DEBUG)
    lagan.enable_color(False)
    lagan.println('case1', lagan.LEVEL_OFF, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_DEBUG, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_INFO, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_WARN, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_ERROR, 'TestPrintOut1:%d', 100)

    s = bytearray()
    for i in range(100):
        s.append(i)
    lagan.print_hex('case1', lagan.LEVEL_INFO, s)
Exemple #2
0
def error(msg: str, *args):
    """打印debug信息"""
    if _filter_level == lagan.LEVEL_OFF or lagan.LEVEL_ERROR < _filter_level:
        return
    lagan.println(_TAG, lagan.LEVEL_ERROR, msg, *args)
Exemple #3
0
def warn(msg: str, *args):
    """打印warn信息"""
    if _filter_level == lagan.LEVEL_OFF or lagan.LEVEL_WARN < _filter_level:
        return
    lagan.println(_TAG, lagan.LEVEL_WARN, msg, *args)
Exemple #4
0
def info(msg: str, *args):
    """打印info信息"""
    if _filter_level == lagan.LEVEL_OFF or lagan.LEVEL_INFO < _filter_level:
        return
    lagan.println(_TAG, lagan.LEVEL_INFO, msg, *args)
Exemple #5
0
def debug(msg: str, *args):
    """打印debug信息"""
    if _filter_level == lagan.LEVEL_OFF or lagan.LEVEL_DEBUG < _filter_level:
        return
    lagan.println(_TAG, lagan.LEVEL_DEBUG, msg, *args)