From 588329db6e7b94feea06d00f72bace5decf3b995 Mon Sep 17 00:00:00 2001 From: Karl Mikaelsson Date: Thu, 21 Sep 2017 09:19:16 +0200 Subject: [PATCH] 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. --- utils.c | 8 ++++++-- utils.h | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/utils.c b/utils.c index 22f181a..9d3ae8c 100644 --- a/utils.c +++ b/utils.c @@ -241,7 +241,8 @@ static char *subject[] = { "Protocol", "Graphics", "Core", - "SmartCard" + "SmartCard", + "Disk" }; static log_level_t _logger_level = Warning; @@ -256,7 +257,8 @@ static log_level_t _logger_level = Warning; | (1 << Protocol) \ | (1 << Graphics) \ | (1 << Core) \ - | (1 << SmartCard) + | (1 << SmartCard) \ + | (1 << Disk) static int _logger_subjects = DEFAULT_LOGGER_SUBJECTS; @@ -351,6 +353,8 @@ logger_set_subjects(char *subjects) bit = (1 << Core); else if (strcmp(token, "SmartCard") == 0) bit = (1 << SmartCard); + else if (strcmp(token, "Disk") == 0) + bit = (1 << Disk); else continue; diff --git a/utils.h b/utils.h index 23451cf..c6b779f 100644 --- a/utils.h +++ b/utils.h @@ -44,7 +44,8 @@ typedef enum log_subject_t Protocol, Graphics, Core, - SmartCard + SmartCard, + Disk } log_subject_t; void logger(log_subject_t c, log_level_t lvl, char *format, ...);