Skip to content

Commit

Permalink
vdk-core: enable/disable structlog based on config
Browse files Browse the repository at this point in the history
Why?

vdk-structlog has a default config flag set to True when installed.
It relegates all logging configuration to the plugin and is cheked in core,
i.e. if structlog is installed, vdk will use structlog. If it's not installed,
it will use the configuration available in core. The flag is currently checked
using an env variable, which makes it not work.

What?

Check the flag using the config object

How was this tested?

Manually

What kind of change is this?

Bugfix

Signed-off-by: Dilyan Marinov <[email protected]>
  • Loading branch information
Dilyan Marinov committed Feb 12, 2024
1 parent d0ef338 commit 735a361
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def initialize_job(self, context: JobContext) -> None:
)
syslog_enabled = context.core_context.configuration.get_value(SYSLOG_ENABLED)
try: # If logging initialization fails we want to attempt sending telemetry before exiting VDK
if not os.environ.get("VDK_USE_STRUCTLOG"):
if not context.core_context.configuration.get_value("use_structlog"):
configure_loggers(
job_name,
attempt_id,
Expand Down

0 comments on commit 735a361

Please sign in to comment.