Skip to content

Commit b64c9ba

Browse files
committed
chore: change default stream
1 parent 94c53d4 commit b64c9ba

File tree

3 files changed

+37
-24
lines changed

3 files changed

+37
-24
lines changed

poetry.lock

+33-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ readme = "README.md"
99
python = "^3.10"
1010

1111
[tool.poetry.group.dev.dependencies]
12-
ruff = "^0.3.4"
12+
ruff = "^0.11.2"
1313
pytest = "^8.1.1"
1414

1515
[build-system]

remote_log_formatter/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import sys
66
from datetime import datetime
7+
from typing import TextIO
78

89

910
class SimpleFormatter(logging.Formatter):
@@ -72,7 +73,7 @@ def format(self, record: logging.LogRecord) -> str:
7273
return json.dumps(message, default=str)
7374

7475

75-
def setup_logging(json: bool = True) -> None:
76+
def setup_logging(json: bool = True, stream: TextIO = sys.stderr) -> None:
7677
LOG_CONFIG = dict(
7778
version=1,
7879
disable_existing_loggers=False,
@@ -91,7 +92,7 @@ def setup_logging(json: bool = True) -> None:
9192
"console": {
9293
"class": "logging.StreamHandler",
9394
"formatter": "generic" if json else "simple",
94-
"stream": sys.stdout,
95+
"stream": stream,
9596
},
9697
},
9798
formatters={

0 commit comments

Comments
 (0)