Merge "fix: Use debug config from default"

This commit is contained in:
Zuul 2022-05-30 12:47:07 +00:00 committed by Gerrit Code Review
commit 32990f9269
3 changed files with 8 additions and 5 deletions

View File

@ -54,7 +54,7 @@ def setup(
backtrace = True
diagnose = True
else:
default_level = "WARNING"
default_level = "INFO"
backtrace = False
diagnose = True
if level is None:

View File

@ -31,7 +31,10 @@ API_PREFIX = "/api/v1"
async def on_startup() -> None:
configure("skyline")
log_setup(Path(CONF.default.log_dir).joinpath("skyline", "skyline-apiserver.log"))
log_setup(
Path(CONF.default.log_dir).joinpath("skyline", "skyline-apiserver.log"),
debug=CONF.default.debug,
)
policies_setup()
await db_setup()

View File

@ -87,7 +87,7 @@ class TestLog:
log = getattr(LOG, level)
log(content)
file_content = file_sink_captor.read_text()
if debug is False and level in ["debug", "info"]:
if debug is False and level in ["debug"]:
assert f"| {level.upper():<8} |" not in file_content
assert content not in file_content
else:
@ -159,7 +159,7 @@ class TestLog:
log = getattr(LOG, level)
log(content)
std_out, std_err = stream_sink_captor.readouterr()
if debug is False and level in ["debug", "info"]:
if debug is False and level in ["debug"]:
assert f"| {level.upper():<8} |" not in std_err
assert content not in std_err
else:
@ -219,7 +219,7 @@ class TestLog:
log = getattr(std_logger, level)
log(content)
file_content = file_sink_captor.read_text()
if debug is False and level in ["debug", "info"]:
if debug is False and level in ["debug"]:
assert f"| {level.upper():<8} |" not in file_content
assert content not in file_content
else: