Skip to content

Commit

Permalink
Merge pull request #8 from utek/format_msg
Browse files Browse the repository at this point in the history
Allow logging format message
  • Loading branch information
respectus authored Jul 5, 2017
2 parents 11a9569 + d7ee77c commit 6b81cb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion logdna/logdna.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ def flush(self):
logger.error('Error in request to LogDNA: ' + str(e))

def emit(self, record):
msg = self.format(record)
record = record.__dict__
opts = {}
if 'args' in record:
opts = record['args']
message = {
'hostname' : self.hostname,
'timestamp': int(time.time()),
'line': record['msg'],
'line': msg,
'level': record['levelname'] or self.level,
'app': self.app or record['module']
}
Expand Down

0 comments on commit 6b81cb6

Please sign in to comment.