Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
handler = JournaldLogHandler()
class JournaldLogger(logging.Logger):
def __init__(self, level, name="root"):
super(JournaldLogger, self).__init__(name, level)
self.addHandler(handler)
Logger = JournaldLogger(logging.WARNING)