def format_stackdriver_json(record, message):
 (subsecond, second) = math.modf(record.created)
 payload = {'message': message, 'timestamp': {'seconds': int(second), 'nanos': int((subsecond * 1000000000.0))}, 'thread': record.thread, 'severity': record.levelname}
 return json.dumps(payload)

def format_stackdriver_json ( record , message ) : ( subsecond , second ) = math . modf ( record . created ) payload = { 'message' : message , 'timestamp' : { 'seconds' : int ( second ) , 'nanos' : int ( ( subsecond * 1000000000.0 ) ) } , 'thread' : record . thread , 'severity' : record . levelname } return json . dumps ( payload )
helper to format a logrecord in in stackdriver fluentd format .