Add a new Disk log subject

Most of the disk access used to be bunched together with the general
protocol debugging, which made it hard to isolate log messages from
the disk subsystem. This commit introduces a new "Disk" log subject.
This commit is contained in:
Karl Mikaelsson 2017-09-21 09:19:16 +02:00
parent 9d0a4ec100
commit 588329db6e
2 changed files with 8 additions and 3 deletions

View File

@ -241,7 +241,8 @@ static char *subject[] = {
"Protocol", "Protocol",
"Graphics", "Graphics",
"Core", "Core",
"SmartCard" "SmartCard",
"Disk"
}; };
static log_level_t _logger_level = Warning; static log_level_t _logger_level = Warning;
@ -256,7 +257,8 @@ static log_level_t _logger_level = Warning;
| (1 << Protocol) \ | (1 << Protocol) \
| (1 << Graphics) \ | (1 << Graphics) \
| (1 << Core) \ | (1 << Core) \
| (1 << SmartCard) | (1 << SmartCard) \
| (1 << Disk)
static int _logger_subjects = DEFAULT_LOGGER_SUBJECTS; static int _logger_subjects = DEFAULT_LOGGER_SUBJECTS;
@ -351,6 +353,8 @@ logger_set_subjects(char *subjects)
bit = (1 << Core); bit = (1 << Core);
else if (strcmp(token, "SmartCard") == 0) else if (strcmp(token, "SmartCard") == 0)
bit = (1 << SmartCard); bit = (1 << SmartCard);
else if (strcmp(token, "Disk") == 0)
bit = (1 << Disk);
else else
continue; continue;

View File

@ -44,7 +44,8 @@ typedef enum log_subject_t
Protocol, Protocol,
Graphics, Graphics,
Core, Core,
SmartCard SmartCard,
Disk
} log_subject_t; } log_subject_t;
void logger(log_subject_t c, log_level_t lvl, char *format, ...); void logger(log_subject_t c, log_level_t lvl, char *format, ...);