Skip to content

Commit

Permalink
chore: better meta handling
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Apr 22, 2024
1 parent 3c95e67 commit 788d060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/netius/base/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def emit(self, record):
"level": record.levelname,
"path": record.pathname,
"lineno": record.lineno,
"meta": getattr(record, "meta", None),
"host": socket.gethostname(),
"hostname": socket.gethostname(),
"tid": threading.current_thread().ident,
Expand All @@ -136,6 +135,8 @@ def emit(self, record):
"identifier_long": common.IDENTIFIER_LONG,
"netius": True
}
if hasattr(record, "meta"):
log["meta"] = record.meta

self.messages.append(log)
should_flush = len(self.messages) >= self.max_length
Expand Down

0 comments on commit 788d060

Please sign in to comment.