Skip to content

Commit 10c611d

Browse files
author
Artur Shiriev
committed
revert setting to enable logging
1 parent 48f8d16 commit 10c611d

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

docs/introduction/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ For FastStream you must provide additionally:
8686

8787
## Structlog
8888

89-
To bootstrap Structlog, you must keep `logging_enabled` to True
89+
To bootstrap Structlog, you must set `service_debug` to False
9090

9191
Additional parameters:
9292

lite_bootstrap/instruments/logging_instrument.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ def __call__(self, *args: typing.Any) -> logging.Logger: # noqa: ANN401
8383

8484
@dataclasses.dataclass(kw_only=True, frozen=True)
8585
class LoggingConfig(BaseConfig):
86-
logging_enabled: bool = True
8786
logging_log_level: int = logging.INFO
8887
logging_flush_level: int = logging.ERROR
8988
logging_buffer_capacity: int = 10
@@ -96,11 +95,11 @@ class LoggingConfig(BaseConfig):
9695
@dataclasses.dataclass(kw_only=True, slots=True, frozen=True)
9796
class LoggingInstrument(BaseInstrument):
9897
bootstrap_config: LoggingConfig
99-
not_ready_message = "logging_enabled is False"
98+
not_ready_message = "service_debug is True"
10099
missing_dependency_message = "structlog is not installed"
101100

102101
def is_ready(self) -> bool:
103-
return self.bootstrap_config.logging_enabled and import_checker.is_structlog_installed
102+
return not self.bootstrap_config.service_debug and import_checker.is_structlog_installed
104103

105104
@staticmethod
106105
def check_dependencies() -> bool:

tests/test_free_bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_free_bootstrap(free_bootstrapper_config: FreeBootstrapperConfig) -> Non
3333
def test_free_bootstrap_logging_not_ready(log_output: list[EventDict]) -> None:
3434
FreeBootstrapper(
3535
bootstrap_config=FreeBootstrapperConfig(
36-
logging_enabled=False,
36+
service_debug=True,
3737
opentelemetry_endpoint="otl",
3838
opentelemetry_instrumentors=[CustomInstrumentor()],
3939
opentelemetry_log_traces=True,
@@ -42,7 +42,7 @@ def test_free_bootstrap_logging_not_ready(log_output: list[EventDict]) -> None:
4242
),
4343
)
4444
assert log_output == [
45-
{"event": "LoggingInstrument is not ready, because logging_enabled is False", "log_level": "info"}
45+
{"event": "LoggingInstrument is not ready, because service_debug is True", "log_level": "info"}
4646
]
4747

4848

0 commit comments

Comments
 (0)