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 <no-reply+buildbot@haiku-os.org>
Reviewed-by: Oscar Lesta <oscar.lesta@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
Alexander von Gluck IV 2022-08-24 17:28:35 -05:00 committed by Adrien Destugues
parent e486e3c033
commit b6b61bd39f
6 changed files with 18 additions and 18 deletions

View File

@ -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(); \

View File

@ -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(); }

View File

@ -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(); \

View File

@ -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(); \

View File

@ -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)) )

View File

@ -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(); \