Reputation: 9636
I am using Python Structlog. Everything is logged as
event='Something Happened'
I don't want that event keyword and I just want the event data to be logged:
'Something happened'
How do I achieve this?
Upvotes: 0
Views: 1791
Reputation: 4126
You can always write an own renderer that just logs out the event without anything else:
>>> def renderer(logger, name, event_dict):
... return event_dict["event"]
...
>>> import structlog
>>> structlog.configure(processors=[renderer])
>>> structlog.get_logger().msg("look, no struct!")
look, no struct!
Upvotes: 1