Merge pull request #23821 from dtardon/ascii-logging

Allow ASCII fallback for Unicode characters in logs
This commit is contained in:
Yu Watanabe
2022-06-29 03:36:35 +09:00
committed by GitHub
40 changed files with 193 additions and 106 deletions
+4 -2
View File
@@ -8,6 +8,7 @@
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
#include "glyph-util.h"
#include "macro.h"
#include "os-util.h"
#include "parse-util.h"
@@ -146,8 +147,9 @@ int open_extension_release(const char *root, const char *extension, char **ret_p
if (k != 0)
continue;
log_debug("%s/%s: 'user.extension-release.strict' attribute is false…",
extension_release_dir_path, de->d_name);
log_debug("%s/%s: 'user.extension-release.strict' attribute is false%s",
extension_release_dir_path, de->d_name,
special_glyph(SPECIAL_GLYPH_ELLIPSIS));
/* We already found what we were looking for, but there's another candidate?
* We treat this as an error, as we want to enforce that there are no ambiguities
+7 -6
View File
@@ -348,13 +348,13 @@ int unit_file_resolve_symlink(
if (r < 0)
return r;
if (is_path(tail))
log_warning("Suspicious symlink %s/%s→%s, treating as alias.",
dir, filename, simplified);
log_warning("Suspicious symlink %s/%s %s %s, treating as alias.",
dir, filename, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), simplified);
dst = resolve_destination_target ? TAKE_PTR(simplified) : TAKE_PTR(target_name);
} else {
log_debug("Linked unit file: %s/%s → %s", dir, filename, simplified);
log_debug("Linked unit file: %s/%s %s %s", dir, filename, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), simplified);
if (resolve_destination_target)
dst = TAKE_PTR(simplified);
@@ -569,8 +569,8 @@ int unit_file_build_name_map(
r = hashmap_ensure_put(&ids, &string_hash_ops_free_free, key, dst);
if (r < 0)
return log_warning_errno(r, "Failed to add entry to hashmap (%s→%s): %m",
de->d_name, dst);
return log_warning_errno(r, "Failed to add entry to hashmap (%s%s%s): %m",
de->d_name, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), dst);
key = dst = NULL;
}
}
@@ -612,7 +612,8 @@ int unit_file_build_name_map(
r = string_strv_hashmap_put(&names, dst, src);
if (r < 0)
return log_warning_errno(r, "Failed to add entry to hashmap (%s→%s): %m", dst, src);
return log_warning_errno(r, "Failed to add entry to hashmap (%s%s%s): %m",
dst, special_glyph(SPECIAL_GLYPH_ARROW_RIGHT), src);
}
if (cache_timestamp_hash)