]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish: add debug section,level to cache.log
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 20 Aug 2015 13:44:21 +0000 (06:44 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 20 Aug 2015 13:44:21 +0000 (06:44 -0700)
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+.

src/Debug.h

index 596d3d55e3b060d7160f2a18c172526ca9e78996..ca99533bf63a18cabf14f4ff3befa59089559bd7 100644 (file)
@@ -94,8 +94,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(); \
         } \