]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polished debugging messages to use DBG_IMPORTANT, WARNING, etc.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Sep 2011 21:07:13 +0000 (15:07 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Sep 2011 21:07:13 +0000 (15:07 -0600)
src/fs/rock/RockRebuild.cc
src/fs/rock/RockSwapDir.cc
src/main.cc

index 6becb797ccf777fbca71de731c8e4c5b724d948c..ff4c5b84bc83fe9ab56bc9fd9763d830c461d78f 100644 (file)
@@ -138,16 +138,16 @@ Rock::Rebuild::doOneEntry() {
     // get our header
     DbCellHeader header;
     if (buf.contentSize() < static_cast<mb_size_t>(sizeof(header))) {
-        debugs(47, 1, "cache_dir[" << sd->index << "]: " <<
-            "truncated swap entry meta data at " << dbOffset);
+        debugs(47, DBG_IMPORTANT, "WARNING: cache_dir[" << sd->index << "]: " <<
+            "Ignoring truncated cache entry meta data at " << dbOffset);
         counts.invalid++;
         return;
     }
     memcpy(&header, buf.content(), sizeof(header));
 
     if (!header.sane()) {
-        debugs(47, 1, "cache_dir[" << sd->index << "]: " <<
-            "malformed rock db cell header at " << dbOffset);
+        debugs(47, DBG_IMPORTANT, "WARNING: cache_dir[" << sd->index << "]: " <<
+            "Ignoring malformed cache entry meta data at " << dbOffset);
         counts.invalid++;
         return;
     }
index 4532873e4c8f7e04a2768282a32df69cbc1817cc..1ea7fd7b204d09eab03500c5f44b62b5ebfad49d 100644 (file)
@@ -147,14 +147,14 @@ Rock::SwapDir::create()
 
     struct stat swap_sb;
     if (::stat(path, &swap_sb) < 0) {
-        debugs (47, 1, "Creating Rock db directory: " << path);
+        debugs (47, DBG_IMPORTANT, "Creating Rock db directory: " << path);
 #ifdef _SQUID_MSWIN_
         const int res = mkdir(path);
 #else
         const int res = mkdir(path, 0700);
 #endif
         if (res != 0) {
-            debugs(47,0, "Failed to create Rock db dir " << path <<
+            debugs(47, DBG_CRITICAL, "Failed to create Rock db dir " << path <<
                 ": " << xstrerror());
             fatal("Rock Store db creation error");
                }
@@ -219,7 +219,8 @@ Rock::SwapDir::init()
         io = m->createStrategy();
         io->init();
     } else {
-        debugs(47,1, "Rock store is missing DiskIO module: " << ioModule);
+        debugs(47, DBG_CRITICAL, "FATAL: Rock store is missing DiskIO module: " <<
+               ioModule);
         fatal("Rock Store missing a required DiskIO module");
     }
 
@@ -485,19 +486,14 @@ Rock::SwapDir::openStoreIO(StoreEntry &e, StoreIOState::STFNCB *cbFile, StoreIOS
 void
 Rock::SwapDir::ioCompletedNotification()
 {
-    if (!theFile) {
-        debugs(47, 1, HERE << filePath << ": initialization failure or " <<
-            "premature close of rock db file");
+    if (!theFile)
         fatalf("Rock cache_dir failed to initialize db file: %s", filePath);
-    }
 
-    if (theFile->error()) {
-        debugs(47, 1, HERE << filePath << ": " << xstrerror());
-        fatalf("Rock cache_dir failed to open db file: %s", filePath);
-       }
+    if (theFile->error())
+        fatalf("Rock cache_dir at %s failed to open db file: %s", filePath,
+               xstrerror());
 
-    // TODO: lower debugging level
-    debugs(47,1, "Rock cache_dir[" << index << "] limits: " << 
+    debugs(47, 2, "Rock cache_dir[" << index << "] limits: " <<
         std::setw(12) << maxSize() << " disk bytes and " <<
         std::setw(7) << map->entryLimit() << " entries");
 
@@ -562,8 +558,8 @@ Rock::SwapDir::full() const
 // but it should not happen for us
 void
 Rock::SwapDir::diskFull() {
-    debugs(20,1, "Internal ERROR: No space left error with rock cache_dir: " <<
-        filePath);
+    debugs(20, DBG_IMPORTANT, "Internal ERROR: No space left with " <<
+        "rock cache_dir: " << filePath);
 }
 
 /// purge while full(); it should be sufficient to purge just one
index 1d9c17822802d0feaadc85298f66f4e386af49e8..bd83f522b47756c0a2863cef5fd3c40f8fb8d0cb 100644 (file)
@@ -1246,10 +1246,11 @@ SquidMainSafe(int argc, char **argv)
     try {
         return SquidMain(argc, argv);
     } catch (const std::exception &e) {
-        debugs(0,0, "dying from an unhandled exception: " << e.what());
+        debugs(1, DBG_CRITICAL, "FATAL: dying from an unhandled exception: " <<
+            e.what());
         throw;
     } catch (...) {
-        debugs(0,0, "dying from an unhandled exception.");
+        debugs(1, DBG_CRITICAL, "FATAL: dying from an unhandled exception.");
         throw;
     }
     return -1; // not reached