]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polish: add debug section,level to cache.log
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 11 Aug 2015 06:15:34 +0000 (23:15 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 11 Aug 2015 06:15:34 +0000 (23:15 -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 ff7f25cab0791fd50f4200c1b641731d6fb24199..668fd78f346415777e671b3e034d2445b424f1cc 100644 (file)
@@ -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(); \
         } \