Move "character has no narrow representation" to flog

This was a warning, which is kind of ridiculous, as it's inactionable
error spew.

Fixes #2815.
This commit is contained in:
Fabian Homborg
2019-06-19 12:34:16 +02:00
parent 9b9c6e312c
commit 370f5356a1
2 changed files with 3 additions and 2 deletions

View File

@@ -414,7 +414,7 @@ std::string wcs2string(const wcstring &input) {
std::memset(converted, 0, sizeof converted);
size_t len = std::wcrtomb(converted, wc, &state);
if (len == (size_t)-1) {
debug(1, L"Wide character U+%4X has no narrow representation", wc);
FLOGF(char_encoding, L"Wide character U+%4X has no narrow representation", wc);
std::memset(&state, 0, sizeof(state));
} else {
result.append(converted, len);
@@ -452,7 +452,7 @@ static char *wcs2str_internal(const wchar_t *in, char *out) {
} else {
size_t len = std::wcrtomb(&out[out_pos], in[in_pos], &state);
if (len == (size_t)-1) {
debug(1, L"Wide character U+%4X has no narrow representation", in[in_pos]);
FLOGF(char_encoding, L"Wide character U+%4X has no narrow representation", in[in_pos]);
std::memset(&state, 0, sizeof(state));
} else {
out_pos += len;

View File

@@ -71,6 +71,7 @@ class category_list_t {
category_t env_export{L"env-export", L"Changes to exported variables"};
category_t topic_monitor{L"topic-monitor", L"Internal details of the topic monitor"};
category_t char_encoding{L"char-encoding", L"Character encoding issues"};
};
/// The class responsible for logging.