Skip to content

Commit 6936d95

Browse files
committed
Match StdlibFormatter signature with that of logger.Formatter
1 parent 450a106 commit 6936d95

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

ecs_logging/_stdlib.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,16 @@ class StdlibFormatter(logging.Formatter):
7171
} | _LOGRECORD_DIR
7272
converter = time.gmtime
7373

74-
def __init__(self, stack_trace_limit=None, exclude_fields=()):
75-
# type: (Any, Optional[int], Sequence[str]) -> None
74+
def __init__(
75+
self,
76+
fmt=None,
77+
datefmt=None,
78+
style="%",
79+
validate=True,
80+
stack_trace_limit=None,
81+
exclude_fields=(),
82+
):
83+
# type: (Any, Optional[str], Optional[str], str, bool, Optional[int], Sequence[str]) -> None
7684
"""Initialize the ECS formatter.
7785
7886
:param int stack_trace_limit:
@@ -91,7 +99,9 @@ def __init__(self, stack_trace_limit=None, exclude_fields=()):
9199
92100
exclude_keys=["error"]
93101
"""
94-
super(StdlibFormatter, self).__init__()
102+
super(StdlibFormatter, self).__init__(
103+
fmt=fmt, datefmt=datefmt, style=style, validate=validate
104+
)
95105

96106
if stack_trace_limit is not None:
97107
if not isinstance(stack_trace_limit, int):

0 commit comments

Comments
 (0)