python-json-logger 3.2.1.dev1__py3-none-any.whl → 4.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-json-logger
3
- Version: 3.2.1.dev1
3
+ Version: 4.0.0
4
4
  Summary: JSON Log Formatter for the Python Logging Package
5
5
  Author-email: Zakaria Zajac <zak@madzak.com>, Nicholas Hairs <info+python-json-logger@nicholashairs.com>
6
6
  Maintainer-email: Nicholas Hairs <info+python-json-logger@nicholashairs.com>
@@ -27,8 +27,7 @@ License-File: NOTICE
27
27
  Requires-Dist: typing_extensions; python_version < "3.10"
28
28
  Provides-Extra: dev
29
29
  Requires-Dist: orjson; implementation_name != "pypy" and extra == "dev"
30
- Requires-Dist: msgspec; (implementation_name != "pypy" and python_version < "3.13") and extra == "dev"
31
- Requires-Dist: msgspec-python313-pre; (implementation_name != "pypy" and python_version == "3.13") and extra == "dev"
30
+ Requires-Dist: msgspec; implementation_name != "pypy" and extra == "dev"
32
31
  Requires-Dist: validate-pyproject[all]; extra == "dev"
33
32
  Requires-Dist: black; extra == "dev"
34
33
  Requires-Dist: pylint; extra == "dev"
@@ -46,9 +45,11 @@ Requires-Dist: mkdocstrings[python]; extra == "dev"
46
45
  Requires-Dist: mkdocs-gen-files; extra == "dev"
47
46
  Requires-Dist: mkdocs-literate-nav; extra == "dev"
48
47
  Requires-Dist: mike; extra == "dev"
48
+ Dynamic: license-file
49
49
 
50
50
  [![PyPi](https://img.shields.io/pypi/v/python-json-logger.svg)](https://pypi.python.org/pypi/python-json-logger/)
51
51
  [![PyPI - Status](https://img.shields.io/pypi/status/python-json-logger)](https://pypi.python.org/pypi/python-json-logger/)
52
+ [![PyPI - Downloads](https://img.shields.io/pypi/dm/python-json-logger)](https://pypi.python.org/pypi/python-json-logger/)
52
53
  [![Python Versions](https://img.shields.io/pypi/pyversions/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
53
54
  [![License](https://img.shields.io/github/license/nhairs/python-json-logger.svg)](https://github.com/nhairs/python-json-logger)
54
55
  ![Build Status](https://github.com/nhairs/python-json-logger/actions/workflows/test-suite.yml/badge.svg)
@@ -0,0 +1,16 @@
1
+ python_json_logger-4.0.0.dist-info/licenses/LICENSE,sha256=GOqVF546Xg4k62zhbED7--IxM8JQKTOi91-KPhoFW1Q,1329
2
+ python_json_logger-4.0.0.dist-info/licenses/NOTICE,sha256=uRQnFcGZCwuIBR2AIHVvhKi9w1KkiI_vAyralfxCsk4,209
3
+ pythonjsonlogger/__init__.py,sha256=2QcveuId10CyXff_BtJ_6kXIarHT5oq66XHHMFiaE8s,419
4
+ pythonjsonlogger/core.py,sha256=7n2y-jUpLO_D826OYq0eA8u4PAQcKr3vJWeQbsP604E,15988
5
+ pythonjsonlogger/defaults.py,sha256=-XgxIj8ioq7CsnBBMsQhTRpU-lKbLrpQLJTCaT3iH38,6577
6
+ pythonjsonlogger/exception.py,sha256=r3DXDk7TThscnMVNPpVRaRSFHTnY-ygea6nn-FgjwsI,804
7
+ pythonjsonlogger/json.py,sha256=jiVE029rsnuXUUNghNwHaWsuQQ6rSZGRHVx8FKvVV_c,4069
8
+ pythonjsonlogger/jsonlogger.py,sha256=sfltkYGwRhRvqcpT-kxlPfcMuOc4ngEa4W4NVTiBpMI,417
9
+ pythonjsonlogger/msgspec.py,sha256=xZLqPwS8MqjtOwdnMY8tgCq5yMtKaytY5tXEV_YLhLo,2145
10
+ pythonjsonlogger/orjson.py,sha256=Fd8eurRQsMZ6JB9zdClfjogWJ5J15NOTsbjH7p9jzsE,2341
11
+ pythonjsonlogger/py.typed,sha256=4RLptUHQuSqzK6CDbigff8uvWQjwPPQMxikWPkV4OtA,80
12
+ pythonjsonlogger/utils.py,sha256=qr04nb61TkVw7cJTXAtLBfyH_NBvyYUlR_mehH76-RM,1126
13
+ python_json_logger-4.0.0.dist-info/METADATA,sha256=iod-ejRjvV0B9I61WjJvoGOvInA4JnQr0oeAauDwO7A,3991
14
+ python_json_logger-4.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ python_json_logger-4.0.0.dist-info/top_level.txt,sha256=9G-OsTkbwPgM8t-bXKPmWDBRZv9cbzLIiEDE5EnGk2I,17
16
+ python_json_logger-4.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
pythonjsonlogger/core.py CHANGED
@@ -7,11 +7,10 @@ from __future__ import annotations
7
7
 
8
8
  ## Standard Library
9
9
  from datetime import datetime, timezone
10
- import importlib
11
10
  import logging
12
11
  import re
13
12
  import sys
14
- from typing import Optional, Union, Callable, List, Dict, Container, Any, Sequence
13
+ from typing import Optional, Union, List, Dict, Container, Any, Sequence
15
14
 
16
15
  if sys.version_info >= (3, 10):
17
16
  from typing import TypeAlias
@@ -72,31 +71,15 @@ STYLE_PERCENT_REGEX = re.compile(r"%\((.+?)\)", re.IGNORECASE) # % style
72
71
 
73
72
  ## Type Aliases
74
73
  ## -----------------------------------------------------------------------------
75
- OptionalCallableOrStr: TypeAlias = Optional[Union[Callable, str]]
76
- """Type alias"""
74
+ LogData: TypeAlias = Dict[str, Any]
75
+ """Type alias
77
76
 
78
- LogRecord: TypeAlias = Dict[str, Any]
79
- """Type alias"""
77
+ *Changed in 4.0*: renamed from `LogRecord` to `LogData`
78
+ """
80
79
 
81
80
 
82
81
  ### FUNCTIONS
83
82
  ### ============================================================================
84
- def str_to_object(obj: Any) -> Any:
85
- """Import strings to an object, leaving non-strings as-is.
86
-
87
- Args:
88
- obj: the object or string to process
89
-
90
- *New in 3.1*
91
- """
92
-
93
- if not isinstance(obj, str):
94
- return obj
95
-
96
- module_name, attribute_name = obj.rsplit(".", 1)
97
- return getattr(importlib.import_module(module_name), attribute_name)
98
-
99
-
100
83
  def merge_record_extra(
101
84
  record: logging.LogRecord,
102
85
  target: Dict,
@@ -134,6 +117,8 @@ class BaseJsonFormatter(logging.Formatter):
134
117
  *New in 3.1*
135
118
 
136
119
  *Changed in 3.2*: `defaults` argument is no longer ignored.
120
+
121
+ *Added in 3.3*: `exc_info_as_array` and `stack_info_as_array` options are added.
137
122
  """
138
123
 
139
124
  _style: Union[logging.PercentStyle, str] # type: ignore[assignment]
@@ -143,7 +128,7 @@ class BaseJsonFormatter(logging.Formatter):
143
128
  # pylint: disable=too-many-arguments,super-init-not-called
144
129
  def __init__(
145
130
  self,
146
- fmt: Optional[str] = None,
131
+ fmt: Optional[Union[str, Sequence[str]]] = None,
147
132
  datefmt: Optional[str] = None,
148
133
  style: str = "%",
149
134
  validate: bool = True,
@@ -155,14 +140,16 @@ class BaseJsonFormatter(logging.Formatter):
155
140
  reserved_attrs: Optional[Sequence[str]] = None,
156
141
  timestamp: Union[bool, str] = False,
157
142
  defaults: Optional[Dict[str, Any]] = None,
143
+ exc_info_as_array: bool = False,
144
+ stack_info_as_array: bool = False,
158
145
  ) -> None:
159
146
  """
160
147
  Args:
161
- fmt: string representing fields to log
148
+ fmt: String format or `Sequence` of field names of fields to log.
162
149
  datefmt: format to use when formatting `asctime` field
163
- style: how to extract log fields from `fmt`
150
+ style: how to extract log fields from `fmt`. Ignored if `fmt` is a `Sequence[str]`.
164
151
  validate: validate `fmt` against style, if implementing a custom `style` you
165
- must set this to `False`.
152
+ must set this to `False`. Ignored if `fmt` is a `Sequence[str]`.
166
153
  defaults: a dictionary containing default fields that are added before all other fields and
167
154
  may be overridden. The supplied fields are still subject to `rename_fields`.
168
155
  prefix: an optional string prefix added at the beginning of
@@ -177,6 +164,8 @@ class BaseJsonFormatter(logging.Formatter):
177
164
  outputting the json log record. If string is passed, timestamp will be added
178
165
  to log record using string as key. If True boolean is passed, timestamp key
179
166
  will be "timestamp". Defaults to False/off.
167
+ exc_info_as_array: break the exc_info into a list of lines based on line breaks.
168
+ stack_info_as_array: break the stack_info into a list of lines based on line breaks.
180
169
 
181
170
  *Changed in 3.1*:
182
171
 
@@ -186,39 +175,66 @@ class BaseJsonFormatter(logging.Formatter):
186
175
  - Renaming fields now preserves the order that fields were added in and avoids adding
187
176
  missing fields. The original behaviour, missing fields have a value of `None`, is still
188
177
  available by setting `rename_fields_keep_missing` to `True`.
178
+
179
+ *Added in 4.0*:
180
+
181
+ - `fmt` now supports comma seperated lists (`style=","`). Note that this style is specific
182
+ to `python-json-logger` and thus care should be taken to not to pass this format to other
183
+ logging Formatter implementations.
184
+ - `fmt` now supports sequences of strings (e.g. lists and tuples) of field names.
189
185
  """
190
186
  ## logging.Formatter compatibility
191
187
  ## ---------------------------------------------------------------------
192
- # Note: validate added in 3.8, defaults added in 3.10
193
- if style in logging._STYLES:
194
- _style = logging._STYLES[style][0](fmt) # type: ignore[operator]
195
- if validate:
196
- _style.validate()
197
- self._style = _style
198
- self._fmt = _style._fmt
199
-
200
- elif not validate:
201
- self._style = style
202
- self._fmt = fmt
203
-
204
- else:
205
- raise ValueError(f"Style must be one of: {','.join(logging._STYLES.keys())}")
188
+ # Note: validate added in python 3.8, defaults added in 3.10
189
+ if fmt is None or isinstance(fmt, str):
190
+ if style in logging._STYLES:
191
+ _style = logging._STYLES[style][0](fmt) # type: ignore[operator]
192
+ if validate:
193
+ _style.validate()
194
+ self._style = _style
195
+ self._fmt = _style._fmt
196
+
197
+ elif style == "," or not validate:
198
+ self._style = style
199
+ self._fmt = fmt
200
+ # TODO: Validate comma format
201
+
202
+ else:
203
+ raise ValueError("Style must be one of: '%{$,'")
204
+
205
+ self._required_fields = self.parse()
206
+
207
+ # Note: we do this check second as string is still a Sequence[str]
208
+ elif isinstance(fmt, Sequence):
209
+ self._style = "__sequence__"
210
+ self._fmt = str(fmt)
211
+ self._required_fields = list(fmt)
206
212
 
207
213
  self.datefmt = datefmt
208
214
 
209
215
  ## JSON Logging specific
210
216
  ## ---------------------------------------------------------------------
211
217
  self.prefix = prefix
212
- self.rename_fields = rename_fields if rename_fields is not None else {}
218
+
219
+ # We recreate the dict in rename_fields and static_fields to support internal/external
220
+ # references which require getting the item to do the conversion.
221
+ # For more details see: https://github.com/nhairs/python-json-logger/pull/45
222
+ self.rename_fields = (
223
+ {key: rename_fields[key] for key in rename_fields} if rename_fields is not None else {}
224
+ )
225
+ self.static_fields = (
226
+ {key: static_fields[key] for key in static_fields} if static_fields is not None else {}
227
+ )
228
+
213
229
  self.rename_fields_keep_missing = rename_fields_keep_missing
214
- self.static_fields = static_fields if static_fields is not None else {}
215
230
  self.reserved_attrs = set(reserved_attrs if reserved_attrs is not None else RESERVED_ATTRS)
216
231
  self.timestamp = timestamp
217
232
 
218
- self._required_fields = self.parse()
219
233
  self._skip_fields = set(self._required_fields)
220
234
  self._skip_fields.update(self.reserved_attrs)
221
235
  self.defaults = defaults if defaults is not None else {}
236
+ self.exc_info_as_array = exc_info_as_array
237
+ self.stack_info_as_array = stack_info_as_array
222
238
  return
223
239
 
224
240
  def format(self, record: logging.LogRecord) -> str:
@@ -252,11 +268,11 @@ class BaseJsonFormatter(logging.Formatter):
252
268
  if record.stack_info and not message_dict.get("stack_info"):
253
269
  message_dict["stack_info"] = self.formatStack(record.stack_info)
254
270
 
255
- log_record: LogRecord = {}
256
- self.add_fields(log_record, record, message_dict)
257
- log_record = self.process_log_record(log_record)
271
+ log_data: LogData = {}
272
+ self.add_fields(log_data, record, message_dict)
273
+ log_data = self.process_log_record(log_data)
258
274
 
259
- return self.serialize_log_record(log_record)
275
+ return self.serialize_log_record(log_data)
260
276
 
261
277
  ## JSON Formatter Specific Methods
262
278
  ## -------------------------------------------------------------------------
@@ -271,6 +287,18 @@ class BaseJsonFormatter(logging.Formatter):
271
287
  Returns:
272
288
  list of fields to be extracted and serialized
273
289
  """
290
+ if self._fmt is None:
291
+ return []
292
+
293
+ if isinstance(self._style, str):
294
+ if self._style == "__sequence__":
295
+ raise RuntimeError("Must not call parse when fmt is a sequence of strings")
296
+
297
+ if self._style == ",":
298
+ return [field.strip() for field in self._fmt.split(",") if field.strip()]
299
+
300
+ raise ValueError(f"Style {self._style!r} is not supported")
301
+
274
302
  if isinstance(self._style, logging.StringTemplateStyle):
275
303
  formatter_style_pattern = STYLE_STRING_TEMPLATE_REGEX
276
304
 
@@ -285,22 +313,21 @@ class BaseJsonFormatter(logging.Formatter):
285
313
  else:
286
314
  raise ValueError(f"Style {self._style!r} is not supported")
287
315
 
288
- if self._fmt:
289
- return formatter_style_pattern.findall(self._fmt)
290
-
291
- return []
316
+ return formatter_style_pattern.findall(self._fmt)
292
317
 
293
- def serialize_log_record(self, log_record: LogRecord) -> str:
294
- """Returns the final representation of the log record.
318
+ def serialize_log_record(self, log_data: LogData) -> str:
319
+ """Returns the final representation of the data to be logged
295
320
 
296
321
  Args:
297
- log_record: the log record
322
+ log_data: the data
323
+
324
+ *Changed in 4.0*: `log_record` renamed to `log_data`
298
325
  """
299
- return self.prefix + self.jsonify_log_record(log_record)
326
+ return self.prefix + self.jsonify_log_record(log_data)
300
327
 
301
328
  def add_fields(
302
329
  self,
303
- log_record: Dict[str, Any],
330
+ log_data: Dict[str, Any],
304
331
  record: logging.LogRecord,
305
332
  message_dict: Dict[str, Any],
306
333
  ) -> None:
@@ -309,38 +336,40 @@ class BaseJsonFormatter(logging.Formatter):
309
336
  This method can be overridden to implement custom logic for adding fields.
310
337
 
311
338
  Args:
312
- log_record: data that will be logged
339
+ log_data: data that will be logged
313
340
  record: the record to extract data from
314
341
  message_dict: dictionary that was logged instead of a message. e.g
315
342
  `logger.info({"is_this_message_dict": True})`
343
+
344
+ *Changed in 4.0*: `log_record` renamed to `log_data`
316
345
  """
317
346
  for field in self.defaults:
318
- log_record[self._get_rename(field)] = self.defaults[field]
347
+ log_data[self._get_rename(field)] = self.defaults[field]
319
348
 
320
349
  for field in self._required_fields:
321
- log_record[self._get_rename(field)] = record.__dict__.get(field)
350
+ log_data[self._get_rename(field)] = record.__dict__.get(field)
322
351
 
323
352
  for data_dict in [self.static_fields, message_dict]:
324
353
  for key, value in data_dict.items():
325
- log_record[self._get_rename(key)] = value
354
+ log_data[self._get_rename(key)] = value
326
355
 
327
356
  merge_record_extra(
328
357
  record,
329
- log_record,
358
+ log_data,
330
359
  reserved=self._skip_fields,
331
360
  rename_fields=self.rename_fields,
332
361
  )
333
362
 
334
363
  if self.timestamp:
335
364
  key = self.timestamp if isinstance(self.timestamp, str) else "timestamp"
336
- log_record[self._get_rename(key)] = datetime.fromtimestamp(
365
+ log_data[self._get_rename(key)] = datetime.fromtimestamp(
337
366
  record.created, tz=timezone.utc
338
367
  )
339
368
 
340
369
  if self.rename_fields_keep_missing:
341
370
  for field in self.rename_fields.values():
342
- if field not in log_record:
343
- log_record[field] = None
371
+ if field not in log_data:
372
+ log_data[field] = None
344
373
  return
345
374
 
346
375
  def _get_rename(self, key: str) -> str:
@@ -348,23 +377,43 @@ class BaseJsonFormatter(logging.Formatter):
348
377
 
349
378
  # Child Methods
350
379
  # ..........................................................................
351
- def jsonify_log_record(self, log_record: LogRecord) -> str:
352
- """Convert this log record into a JSON string.
380
+ def jsonify_log_record(self, log_data: LogData) -> str:
381
+ """Convert the log data into a JSON string.
353
382
 
354
383
  Child classes MUST override this method.
355
384
 
356
385
  Args:
357
- log_record: the data to serialize
386
+ log_data: the data to serialize
387
+
388
+ *Changed in 4.0*: `log_record` renamed to `log_data`
358
389
  """
359
390
  raise NotImplementedError()
360
391
 
361
- def process_log_record(self, log_record: LogRecord) -> LogRecord:
362
- """Custom processing of the log record.
392
+ def process_log_record(self, log_data: LogData) -> LogData:
393
+ """Custom processing of the data to be logged.
363
394
 
364
395
  Child classes can override this method to alter the log record before it
365
396
  is serialized.
366
397
 
367
398
  Args:
368
- log_record: incoming data
399
+ log_data: incoming data
400
+
401
+ *Changed in 4.0*: `log_record` renamed to `log_data`
402
+ """
403
+ return log_data
404
+
405
+ def formatException(self, ei) -> Union[str, list[str]]: # type: ignore
406
+ """Format and return the specified exception information.
407
+
408
+ If exc_info_as_array is set to True, This method returns an array of strings.
409
+ """
410
+ exception_info_str = super().formatException(ei)
411
+ return exception_info_str.splitlines() if self.exc_info_as_array else exception_info_str
412
+
413
+ def formatStack(self, stack_info) -> Union[str, list[str]]: # type: ignore
414
+ """Format and return the specified stack information.
415
+
416
+ If stack_info_as_array is set to True, This method returns an array of strings.
369
417
  """
370
- return log_record
418
+ stack_info_str = super().formatStack(stack_info)
419
+ return stack_info_str.splitlines() if self.stack_info_as_array else stack_info_str
pythonjsonlogger/json.py CHANGED
@@ -67,9 +67,9 @@ class JsonFormatter(core.BaseJsonFormatter):
67
67
  def __init__(
68
68
  self,
69
69
  *args,
70
- json_default: core.OptionalCallableOrStr = None,
71
- json_encoder: core.OptionalCallableOrStr = None,
72
- json_serializer: Union[Callable, str] = json.dumps,
70
+ json_default: Optional[Callable] = None,
71
+ json_encoder: Optional[Callable] = None,
72
+ json_serializer: Callable = json.dumps,
73
73
  json_indent: Optional[Union[int, str]] = None,
74
74
  json_ensure_ascii: bool = True,
75
75
  **kwargs,
@@ -87,19 +87,19 @@ class JsonFormatter(core.BaseJsonFormatter):
87
87
  """
88
88
  super().__init__(*args, **kwargs)
89
89
 
90
- self.json_default = core.str_to_object(json_default)
91
- self.json_encoder = core.str_to_object(json_encoder)
92
- self.json_serializer = core.str_to_object(json_serializer)
90
+ self.json_default = json_default
91
+ self.json_encoder = json_encoder
92
+ self.json_serializer = json_serializer
93
93
  self.json_indent = json_indent
94
94
  self.json_ensure_ascii = json_ensure_ascii
95
95
  if not self.json_encoder and not self.json_default:
96
96
  self.json_encoder = JsonEncoder
97
97
  return
98
98
 
99
- def jsonify_log_record(self, log_record: core.LogRecord) -> str:
100
- """Returns a json string of the log record."""
99
+ def jsonify_log_record(self, log_data: core.LogData) -> str:
100
+ """Returns a json string of the log data."""
101
101
  return self.json_serializer(
102
- log_record,
102
+ log_data,
103
103
  default=self.json_default,
104
104
  cls=self.json_encoder,
105
105
  indent=self.json_indent,
@@ -6,7 +6,7 @@
6
6
  from __future__ import annotations
7
7
 
8
8
  ## Standard Library
9
- from typing import Any
9
+ from typing import Any, Optional, Callable
10
10
 
11
11
  ## Installed
12
12
 
@@ -43,7 +43,7 @@ class MsgspecFormatter(core.BaseJsonFormatter):
43
43
  def __init__(
44
44
  self,
45
45
  *args,
46
- json_default: core.OptionalCallableOrStr = msgspec_default,
46
+ json_default: Optional[Callable] = msgspec_default,
47
47
  **kwargs,
48
48
  ) -> None:
49
49
  """
@@ -54,10 +54,10 @@ class MsgspecFormatter(core.BaseJsonFormatter):
54
54
  """
55
55
  super().__init__(*args, **kwargs)
56
56
 
57
- self.json_default = core.str_to_object(json_default)
57
+ self.json_default = json_default
58
58
  self._encoder = msgspec.json.Encoder(enc_hook=self.json_default)
59
59
  return
60
60
 
61
- def jsonify_log_record(self, log_record: core.LogRecord) -> str:
62
- """Returns a json string of the log record."""
63
- return self._encoder.encode(log_record).decode("utf8")
61
+ def jsonify_log_record(self, log_data: core.LogData) -> str:
62
+ """Returns a json string of the log data."""
63
+ return self._encoder.encode(log_data).decode("utf8")
@@ -6,7 +6,7 @@
6
6
  from __future__ import annotations
7
7
 
8
8
  ## Standard Library
9
- from typing import Any
9
+ from typing import Any, Optional, Callable
10
10
 
11
11
  ## Installed
12
12
 
@@ -45,7 +45,7 @@ class OrjsonFormatter(core.BaseJsonFormatter):
45
45
  def __init__(
46
46
  self,
47
47
  *args,
48
- json_default: core.OptionalCallableOrStr = orjson_default,
48
+ json_default: Optional[Callable] = orjson_default,
49
49
  json_indent: bool = False,
50
50
  **kwargs,
51
51
  ) -> None:
@@ -58,14 +58,14 @@ class OrjsonFormatter(core.BaseJsonFormatter):
58
58
  """
59
59
  super().__init__(*args, **kwargs)
60
60
 
61
- self.json_default = core.str_to_object(json_default)
61
+ self.json_default = json_default
62
62
  self.json_indent = json_indent
63
63
  return
64
64
 
65
- def jsonify_log_record(self, log_record: core.LogRecord) -> str:
66
- """Returns a json string of the log record."""
65
+ def jsonify_log_record(self, log_data: core.LogData) -> str:
66
+ """Returns a json string of the log data."""
67
67
  opt = orjson.OPT_NON_STR_KEYS
68
68
  if self.json_indent:
69
69
  opt |= orjson.OPT_INDENT_2
70
70
 
71
- return orjson.dumps(log_record, default=self.json_default, option=opt).decode("utf8")
71
+ return orjson.dumps(log_data, default=self.json_default, option=opt).decode("utf8")
@@ -1,16 +0,0 @@
1
- pythonjsonlogger/__init__.py,sha256=2QcveuId10CyXff_BtJ_6kXIarHT5oq66XHHMFiaE8s,419
2
- pythonjsonlogger/core.py,sha256=zrf2vBMPVjPv5ornwWs2TOi68FbWDnuhj_DrcUiuBG0,13328
3
- pythonjsonlogger/defaults.py,sha256=-XgxIj8ioq7CsnBBMsQhTRpU-lKbLrpQLJTCaT3iH38,6577
4
- pythonjsonlogger/exception.py,sha256=r3DXDk7TThscnMVNPpVRaRSFHTnY-ygea6nn-FgjwsI,804
5
- pythonjsonlogger/json.py,sha256=TsKD_1-TDjaeMUg6la_aVzIWd7GBxgAntY6zWzVe7lU,4165
6
- pythonjsonlogger/jsonlogger.py,sha256=sfltkYGwRhRvqcpT-kxlPfcMuOc4ngEa4W4NVTiBpMI,417
7
- pythonjsonlogger/msgspec.py,sha256=M5kiIX4RLr1PwvWKx21N8sgk05LCFymBAWM4cRR3VNA,2161
8
- pythonjsonlogger/orjson.py,sha256=HVhIHo7CrTwj9pZuZzUmj1qsW0coNdVmDKSDycDs-pM,2357
9
- pythonjsonlogger/py.typed,sha256=4RLptUHQuSqzK6CDbigff8uvWQjwPPQMxikWPkV4OtA,80
10
- pythonjsonlogger/utils.py,sha256=qr04nb61TkVw7cJTXAtLBfyH_NBvyYUlR_mehH76-RM,1126
11
- python_json_logger-3.2.1.dev1.dist-info/LICENSE,sha256=GOqVF546Xg4k62zhbED7--IxM8JQKTOi91-KPhoFW1Q,1329
12
- python_json_logger-3.2.1.dev1.dist-info/METADATA,sha256=0IeIadiU85OUHVlSmaK_IkDVajdlbJsRVHvnSjFmajE,3999
13
- python_json_logger-3.2.1.dev1.dist-info/NOTICE,sha256=uRQnFcGZCwuIBR2AIHVvhKi9w1KkiI_vAyralfxCsk4,209
14
- python_json_logger-3.2.1.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
15
- python_json_logger-3.2.1.dev1.dist-info/top_level.txt,sha256=9G-OsTkbwPgM8t-bXKPmWDBRZv9cbzLIiEDE5EnGk2I,17
16
- python_json_logger-3.2.1.dev1.dist-info/RECORD,,