environment-d-generator: output logs in debug mode

Those codepaths is only used by that generator, so simply adding a few debug
log lines should be OK.

Fixes #12259.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-08-26 22:53:01 +02:00
parent 3a5a08bbb4
commit f6301bdc81
2 changed files with 11 additions and 0 deletions

View file

@ -485,6 +485,8 @@ static int merge_env_file_push(
free_and_replace(value, expanded_value);
log_debug("%s:%u: setting %s=%s", filename, line, key, value);
return load_env_file_push(filename, line, key, value, env, n_pushed);
}

View file

@ -28,6 +28,13 @@ static int environment_dirs(char ***ret) {
if (r < 0)
return r;
if (DEBUG_LOGGING) {
_cleanup_free_ char *t;
t = strv_join(dirs, "\n\t");
log_debug("Looking for environment.d files in (higher priority first):\n\t%s", strna(t));
}
*ret = TAKE_PTR(dirs);
return 0;
}
@ -49,6 +56,8 @@ static int load_and_print(void) {
* that in case of failure, a partial update is better than none. */
STRV_FOREACH(i, files) {
log_debug("Reading %s…", *i);
r = merge_env_file(&env, NULL, *i);
if (r == -ENOMEM)
return r;