MCPcopy Create free account
hub / github.com/hynek/structlog / PrintLoggerFactory

Class PrintLoggerFactory

src/structlog/_output.py:119–137  ·  view source on GitHub ↗

r""" Produce `PrintLogger`\ s. To be used with `structlog.configure`\ 's ``logger_factory``. Args: file: File to print to. (default: `sys.stdout`) Positional arguments are silently ignored. .. versionadded:: 0.4.0

Source from the content-addressed store, hash-verified

117
118
119class PrintLoggerFactory:
120 r"""
121 Produce `PrintLogger`\ s.
122
123 To be used with `structlog.configure`\ 's ``logger_factory``.
124
125 Args:
126 file: File to print to. (default: `sys.stdout`)
127
128 Positional arguments are silently ignored.
129
130 .. versionadded:: 0.4.0
131 """
132
133 def __init__(self, file: TextIO | None = None):
134 self._file = file
135
136 def __call__(self, *args: Any) -> PrintLogger:
137 return PrintLogger(self._file)
138
139
140class WriteLogger:

Callers 4

test_does_not_cacheMethod · 0.90
test_passes_fileMethod · 0.90
test_ignores_argsMethod · 0.90
_config.pyFile · 0.85

Calls

no outgoing calls

Tested by 3

test_does_not_cacheMethod · 0.72
test_passes_fileMethod · 0.72
test_ignores_argsMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…