pythonjsonlogger.msgspec
🔗
JSON Formatter using msgspec
MsgspecFormatter
🔗
MsgspecFormatter(
*args,
json_default: OptionalCallableOrStr = msgspec_default,
**kwargs
)
Bases: BaseJsonFormatter
JSON formatter using msgspec.json.Encoder
for encoding.
PARAMETER | DESCRIPTION |
---|---|
args |
DEFAULT:
|
json_default |
a function for encoding non-standard objects
TYPE:
|
kwargs |
DEFAULT:
|
add_fields
🔗
Extract fields from a LogRecord for logging
This method can be overridden to implement custom logic for adding fields.
PARAMETER | DESCRIPTION |
---|---|
log_record |
data that will be logged |
record |
the record to extract data from
TYPE:
|
message_dict |
dictionary that was logged instead of a message. e.g
|
format
🔗
Formats a log record and serializes to json
PARAMETER | DESCRIPTION |
---|---|
record |
the record to format
TYPE:
|
jsonify_log_record
🔗
Returns a json string of the log record.