From b6b61bd39f8584990da85150b92913c8a019607a Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Wed, 24 Aug 2022 17:28:35 -0500 Subject: [PATCH] general/logs: Ensure all logs start with THING: * 90% of our logs start with some context on what is generating a log message (thing:) * Things following this logging model however do "thing [time" which is inconsistent * Being consistent will allow us to start scanning logs in a smart way and try to analyze patterns of what is throwing errors, etc in an automatic way. aka /^(service/driver/etc)\:/ Change-Id: I1ef2df4f17f70f858a485554a4e8a3f87f1a69c8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/5568 Tested-by: Commit checker robot Reviewed-by: Oscar Lesta Reviewed-by: Adrien Destugues --- headers/private/file_systems/DebugSupport.h | 6 +++--- headers/private/userlandfs/shared/Debug.h | 6 +++--- src/add-ons/kernel/file_systems/bindfs/DebugSupport.h | 6 +++--- .../kernel/file_systems/netfs/headers/shared/DebugSupport.h | 6 +++--- src/apps/icon-o-matic/generic/support/Debug.h | 6 +++--- src/servers/package/DebugSupport.h | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/headers/private/file_systems/DebugSupport.h b/headers/private/file_systems/DebugSupport.h index c59c6650d4..7272bd46dc 100644 --- a/headers/private/file_systems/DebugSupport.h +++ b/headers/private/file_systems/DebugSupport.h @@ -109,7 +109,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", \ system_time(), DEBUG_THREAD); \ x; \ dbg_printf_end(); \ @@ -117,7 +117,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_FUNCTION(prefix, x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, \ system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__); \ x; \ dbg_printf_end(); \ @@ -125,7 +125,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_LINE(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ", \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ", \ system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__, __LINE__); \ x; \ dbg_printf_end(); \ diff --git a/headers/private/userlandfs/shared/Debug.h b/headers/private/userlandfs/shared/Debug.h index b5864be854..cda2ad704f 100644 --- a/headers/private/userlandfs/shared/Debug.h +++ b/headers/private/userlandfs/shared/Debug.h @@ -91,13 +91,13 @@ void dbg_printf_end(); #endif #define DEBUG_THREAD find_thread(NULL) -#define DEBUG_CONTEXT(x) { dbg_printf_begin(); __out(DEBUG_APP " [%" \ +#define DEBUG_CONTEXT(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%" \ B_PRIdBIGTIME ": %5" B_PRId32 "] ", system_time(), DEBUG_THREAD); \ x; dbg_printf_end(); } #define DEBUG_CONTEXT_FUNCTION(prefix, x) { dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s()" prefix, \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s()" prefix, \ system_time(), DEBUG_THREAD, __FUNCTION__); x; dbg_printf_end(); } -#define DEBUG_CONTEXT_LINE(x) { dbg_printf_begin(); __out(DEBUG_APP " [%" \ +#define DEBUG_CONTEXT_LINE(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%" \ B_PRIdBIGTIME ": %5" B_PRId32 "] %s():%d: ", system_time(), \ DEBUG_THREAD, __FUNCTION__, __LINE__); x; dbg_printf_end(); } diff --git a/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h b/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h index 32ee56449d..62ccd0da58 100644 --- a/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h +++ b/src/add-ons/kernel/file_systems/bindfs/DebugSupport.h @@ -100,7 +100,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", system_time(),\ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", system_time(),\ DEBUG_THREAD); \ x; \ dbg_printf_end(); \ @@ -108,7 +108,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_FUNCTION(prefix, x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, \ system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__); \ x; \ dbg_printf_end(); \ @@ -116,7 +116,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_LINE(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRId64 ": %5" B_PRId32 "] %s:%d: ", \ + __out(DEBUG_APP ": [%" B_PRId64 ": %5" B_PRId32 "] %s:%d: ", \ system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__, __LINE__); \ x; \ dbg_printf_end(); \ diff --git a/src/add-ons/kernel/file_systems/netfs/headers/shared/DebugSupport.h b/src/add-ons/kernel/file_systems/netfs/headers/shared/DebugSupport.h index 07c7be1d96..de7832702a 100644 --- a/src/add-ons/kernel/file_systems/netfs/headers/shared/DebugSupport.h +++ b/src/add-ons/kernel/file_systems/netfs/headers/shared/DebugSupport.h @@ -100,14 +100,14 @@ void dbg_printf_end(); #define DEBUG_CONTEXT(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", system_time(), DEBUG_THREAD); \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", system_time(), DEBUG_THREAD); \ x; \ dbg_printf_end(); \ } #define DEBUG_CONTEXT_FUNCTION(prefix, x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, system_time(), DEBUG_THREAD, \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, system_time(), DEBUG_THREAD, \ __PRETTY_FUNCTION__); \ x; \ dbg_printf_end(); \ @@ -115,7 +115,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_LINE(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ", system_time(), DEBUG_THREAD, \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ", system_time(), DEBUG_THREAD, \ __PRETTY_FUNCTION__, __LINE__); \ x; \ dbg_printf_end(); \ diff --git a/src/apps/icon-o-matic/generic/support/Debug.h b/src/apps/icon-o-matic/generic/support/Debug.h index 3bd1c41699..accbd8d5a1 100644 --- a/src/apps/icon-o-matic/generic/support/Debug.h +++ b/src/apps/icon-o-matic/generic/support/Debug.h @@ -98,9 +98,9 @@ void dbg_printf_end(); #endif #define DEBUG_THREAD find_thread(NULL) -#define DEBUG_CONTEXT(x) { dbg_printf_begin(); __out(DEBUG_APP " [%Ld: %5ld] ", system_time(), DEBUG_THREAD); x; dbg_printf_end(); } -#define DEBUG_CONTEXT_FUNCTION(prefix, x) { dbg_printf_begin(); __out(DEBUG_APP " [%Ld: %5ld] %s()" prefix, system_time(), DEBUG_THREAD, __FUNCTION__); x; dbg_printf_end(); } -#define DEBUG_CONTEXT_LINE(x) { dbg_printf_begin(); __out(DEBUG_APP " [%Ld: %5ld] %s():%d: ", system_time(), DEBUG_THREAD, __FUNCTION__, __LINE__); x; dbg_printf_end(); } +#define DEBUG_CONTEXT(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%Ld: %5ld] ", system_time(), DEBUG_THREAD); x; dbg_printf_end(); } +#define DEBUG_CONTEXT_FUNCTION(prefix, x) { dbg_printf_begin(); __out(DEBUG_APP ": [%Ld: %5ld] %s()" prefix, system_time(), DEBUG_THREAD, __FUNCTION__); x; dbg_printf_end(); } +#define DEBUG_CONTEXT_LINE(x) { dbg_printf_begin(); __out(DEBUG_APP ": [%Ld: %5ld] %s():%d: ", system_time(), DEBUG_THREAD, __FUNCTION__, __LINE__); x; dbg_printf_end(); } #define TPRINT(x) DEBUG_CONTEXT( __out x ) #define TREPORT_ERROR(status) DEBUG_CONTEXT_LINE( __out("%s\n", strerror(status)) ) diff --git a/src/servers/package/DebugSupport.h b/src/servers/package/DebugSupport.h index af6545eaea..357ce6255a 100644 --- a/src/servers/package/DebugSupport.h +++ b/src/servers/package/DebugSupport.h @@ -104,7 +104,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] ", \ system_time(), DEBUG_THREAD); \ x; \ dbg_printf_end(); \ @@ -112,7 +112,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_FUNCTION(prefix, x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s" prefix, \ system_time(), DEBUG_THREAD,__PRETTY_FUNCTION__); \ x; \ dbg_printf_end(); \ @@ -120,7 +120,7 @@ void dbg_printf_end(); #define DEBUG_CONTEXT_LINE(x) \ { \ dbg_printf_begin(); \ - __out(DEBUG_APP " [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ", \ + __out(DEBUG_APP ": [%" B_PRIdBIGTIME ": %5" B_PRId32 "] %s:%d: ", \ system_time(), DEBUG_THREAD, __PRETTY_FUNCTION__, __LINE__); \ x; \ dbg_printf_end(); \