register_schema

omni.structuredlog.register_schema(schema: dict) dict

Register a schema with the structured logging system To be able to send events, you need to register a schema that specifies the data layout of your events.

Parameters

schema – The dict specifying your message schema. This dict can be directly loaded from your JSON schema. If this schema isn’t a valid structured logging schema, this call will throw. Note that the ordering of the events in this dictionary, as well as the ordering of non-constant properties in the events is important. If you pass a schema in with events/properties rearranged, this call will throw an exception.

Returns

This returns a dict, which contains a handle for each event that is used to call send_event(). The keys of this dictionary are the short names of each event. The value of each dictionary entry is opaque and should just be passed to send_event().