Add reader flog category

For both input and reader, because the "reader" term is more general
and we don't have enough messages to justify multiple categories
This commit is contained in:
Fabian Homborg 2020-01-19 14:27:23 +01:00
parent a48926dee5
commit 8b1ac0912b
4 changed files with 6 additions and 3 deletions

View File

@ -92,6 +92,8 @@ class category_list_t {
category_t iothread{L"iothread", L"Background IO thread events"};
category_t term_support{L"term-support", L"Terminal feature detection"};
category_t reader{L"reader", L"The interactive reader/input system"};
};
/// The class responsible for logging.

View File

@ -458,7 +458,7 @@ void inputter_t::mapping_execute_matching_or_generic(bool allow_commands) {
if (auto mapping = find_mapping()) {
mapping_execute(*mapping, allow_commands);
} else {
debug(2, L"no generic found, ignoring char...");
FLOGF(reader, L"no generic found, ignoring char...");
auto evt = event_queue_.readch();
if (evt.is_eof()) {
event_queue_.push_front(evt);

View File

@ -24,6 +24,7 @@
#include "env.h"
#include "env_universal_common.h"
#include "fallback.h" // IWYU pragma: keep
#include "flog.h"
#include "global_safety.h"
#include "input_common.h"
#include "iothread.h"
@ -188,7 +189,7 @@ char_event_t input_event_queue_t::readch() {
switch (sz) {
case static_cast<size_t>(-1): {
std::memset(&state, '\0', sizeof(state));
debug(2, L"Illegal input");
FLOG(reader, L"Illegal input");
return char_event_type_t::check_exit;
}
case static_cast<size_t>(-2): {

View File

@ -3311,7 +3311,7 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
} else {
// This can happen if the user presses a control char we don't recognize. No
// reason to report this to the user unless they've enabled debugging output.
debug(2, _(L"Unknown key binding 0x%X"), c);
FLOGF(reader, _(L"Unknown key binding 0x%X"), c);
}
rls.last_cmd = none();
}