etherlab/runtime_etherlab.py
changeset 2372 51f3acc89a58
parent 2370 e40f3914e55f
child 2375 cfa68a06a24d
equal deleted inserted replaced
2371:f1f10ceb9341 2372:51f3acc89a58
    84     klog.argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_int]
    84     klog.argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_int]
    85     klog.restype = ctypes.c_int
    85     klog.restype = ctypes.c_int
    86     s = ctypes.create_string_buffer(4*1024)
    86     s = ctypes.create_string_buffer(4*1024)
    87     last = None
    87     last = None
    88     while not StopKMSGThread:
    88     while not StopKMSGThread:
    89         l = klog(3, s, len(s)-1)
    89         bytes_to_read = klog(3, s, len(s)-1)
    90         log = s.value[:l-1]
    90         log = s.value[:bytes_to_read-1]
    91         if last :
    91         if last :
    92             log = log.rpartition(last)[2]
    92             log = log.rpartition(last)[2]
    93         if log :
    93         if log :
    94             last = log.rpartition('\n')[2]
    94             last = log.rpartition('\n')[2]
    95             for lvl, msg in re.findall(
    95             for lvl, msg in re.findall(