def METHOD_NAME(charbuf):
    for line in charbuf.splitlines():
        if SCOPE_KEYWORD in line:
            try:
                to_parse = line.split(SCOPE_KEYWORD)[1]
                json_meas = json.loads(to_parse)
                ts.popleft()
                ts.append(int(json_meas['timestamp']))
                meas.popleft()
                meas.append(int(json_meas['current']))
                meas_flt.popleft()
                meas_flt.append(int(json_meas['current_filtered']))
                save_to_csv([int(json_meas['timestamp']), int(json_meas['current']), int(json_meas['current_filtered'])])
            except:
                print("exception in json parse, corrupted data")
        else:
            print(line) # print other logs in console