Skip to content

Commit 53dee9d

Browse files
authored
Merge pull request #1955 from jakecorrenti/propagate-log-level
krun: Propagate crun log level to libkrun
2 parents e86e8e1 + 41a14fe commit 53dee9d

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/libcrun/handlers/krun.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,19 @@ libkrun_exec (void *cookie, libcrun_container_t *container, const char *pathname
395395
if (krun_set_log_level == NULL || krun_start_enter == NULL)
396396
error (EXIT_FAILURE, 0, "could not find symbol in the krun library");
397397

398-
/* Set log level to "error" */
399-
krun_set_log_level (1);
398+
/* Set log level according to crun's verbosity. */
399+
switch (libcrun_get_verbosity ())
400+
{
401+
case LIBCRUN_VERBOSITY_DEBUG:
402+
krun_set_log_level (KRUN_LOG_LEVEL_DEBUG);
403+
break;
404+
case LIBCRUN_VERBOSITY_WARNING:
405+
krun_set_log_level (KRUN_LOG_LEVEL_WARN);
406+
break;
407+
default:
408+
krun_set_log_level (KRUN_LOG_LEVEL_ERROR);
409+
break;
410+
}
400411

401412
if (kconf->sev)
402413
{

0 commit comments

Comments
 (0)