From: Amos Jeffries Date: Tue, 11 Aug 2015 06:15:34 +0000 (-0700) Subject: Polish: add debug section,level to cache.log X-Git-Tag: SQUID_4_0_1~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3304cfef542b09885f0aa0ddbcc9d898aecda318;p=thirdparty%2Fsquid.git Polish: add debug section,level to cache.log Cache.log produced at level ALL,9 are very verbose, and tracking down what specific section,level details to log for a shorter trace without lost details can sometimes be tricky and time consuming. Particularly when multiple sections are involved. This patch adds a column containing the relevant debug_options SECTION,LEVEL value on each line right after the kidN number for debug levels 2+. --- diff --git a/src/Debug.h b/src/Debug.h index ff7f25cab0..668fd78f34 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -99,8 +99,10 @@ const char * SkipBuildPrefix(const char* path); if ((Debug::level = (LEVEL)) <= Debug::Levels[SECTION]) { \ Debug::sectionLevel = Debug::Levels[SECTION]; \ std::ostream &_dbo=Debug::getDebugOut(); \ - if (Debug::level > DBG_IMPORTANT) \ - _dbo << SkipBuildPrefix(__FILE__)<<"("<<__LINE__<<") "<<__FUNCTION__<<": "; \ + if (Debug::level > DBG_IMPORTANT) { \ + _dbo << (SECTION) << ',' << (LEVEL) << "| " \ + << SkipBuildPrefix(__FILE__)<<"("<<__LINE__<<") "<<__FUNCTION__<<": "; \ + } \ _dbo << CONTENT; \ Debug::finishDebug(); \ } \