def ParseLogEntry(entry):
 split = entry.split(' ', 3)
 if ((len(split) == 4) and (split[0] == 'LOG')):
  level = split[1]
  timestamp = split[2]
  message = split[3]
  try:
   message = str(message)
   timestamp = int(timestamp)
   level = int(level)
  except ValueError:
   pass
  else:
   if (0 <= level <= 4):
    return (timestamp, level, message.replace('\x00', '\n'))
 usec = int((time.time() * 1000000.0))
 return (usec, 3, entry.replace('\x00', '\n'))

def ParseLogEntry ( entry ) : split = entry . split ( ' ' , 3 ) if ( ( len ( split ) == 4 ) and ( split [ 0 ] == 'LOG' ) ) : level = split [ 1 ] timestamp = split [ 2 ] message = split [ 3 ] try : message = str ( message ) timestamp = int ( timestamp ) level = int ( level ) except ValueError : pass else : if ( 0 <= level <= 4 ) : return ( timestamp , level , message . replace ( '\x00' , '\n' ) ) usec = int ( ( time . time ( ) * 1000000.0 ) ) return ( usec , 3 , entry . replace ( '\x00' , '\n' ) )
parses a single log entry emitted by app_logging .