Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def write(message, priority=Priority.INFO):
""" Write message into systemd journal
:type priority: Priority
:type message: str
"""
priority = int(Priority(int(priority)))
send(priority=priority, message=message)
data["errno"] = 0 if not record.exc_info else 255
data["relative_ts"] = self._to_microsecond(data.pop("relativeCreated"))
data["thread_name"] = data.pop("threadName")
args = data.pop("args", [])
if isinstance(args, collections.Mapping):
for key, value in args.items():
data["argument_%s" % key] = value
else:
for idx, item in enumerate(args):
data["argument_%d" % idx] = str(item)
if tb_message:
data["traceback"] = tb_message
send(**data)