Skip to content

Commit

Permalink
Revert "Changed default for InmantaBootloader's logging config argume…
Browse files Browse the repository at this point in the history
…nt (PR #8530)"

This reverts commit dd19c6e.
  • Loading branch information
sanderr committed Dec 26, 2024
1 parent dd19c6e commit 94a7c59
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 0 additions & 4 deletions changelogs/unreleased/bootloader-logging-config-default.yml

This file was deleted.

6 changes: 3 additions & 3 deletions src/inmanta/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def start_server(options: argparse.Namespace) -> None:
tracing.configure_logfire("server")
util.ensure_event_loop()

ibl = InmantaBootloader(configure_logging=False)
ibl = InmantaBootloader()

setup_signal_handlers(ibl.stop)

Expand Down Expand Up @@ -900,7 +900,7 @@ def default_logging_config(options: argparse.Namespace) -> None:

if options.cmd == "server":
# Upgrade with extensions
ibl = InmantaBootloader(configure_logging=False)
ibl = InmantaBootloader()
ibl.start_loggers_for_extensions(component_config)

assert component_config._loaded_config is not None # make mypy happy
Expand All @@ -922,7 +922,7 @@ def default_logging_config(options: argparse.Namespace) -> None:
def print_versions_installed_components_and_exit() -> None:
# coroutine to make sure event loop is running for server slices
async def print_status() -> None:
bootloader = InmantaBootloader(configure_logging=False)
bootloader = InmantaBootloader()
app_context = bootloader.load_slices()
product_metadata = app_context.get_product_metadata()
extension_statuses = app_context.get_extension_statuses()
Expand Down
3 changes: 1 addition & 2 deletions src/inmanta/server/bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,10 @@ class InmantaBootloader:
# Cache field for available extensions
AVAILABLE_EXTENSIONS: Optional[dict[str, str]] = None

def __init__(self, *, configure_logging: bool = True) -> None:
def __init__(self, configure_logging: bool = False) -> None:
"""
:param configure_logging: This config option is used by the tests to configure the logging framework.
In normal execution, the logging framework is configured by the app.py
Defaults to true for backwards compatibility.
"""
self.restserver = Server()
self.started = False
Expand Down
2 changes: 1 addition & 1 deletion tests/test_extension_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ async def test_register_setting() -> None:

config.server_enabled_extensions.set("testlogextender")
with splice_extension_in("test_module_path"):
ibl = InmantaBootloader(configure_logging=False)
ibl = InmantaBootloader()
ibl.start_loggers_for_extensions()
logging.info("This is a log line")
assert "TEST TEST TEST" in io.getvalue()

0 comments on commit 94a7c59

Please sign in to comment.