]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Set default formatting flags for the debugging stream to "fixed" with a
authorrousskov <>
Tue, 4 Dec 2007 22:20:22 +0000 (22:20 +0000)
committerrousskov <>
Tue, 4 Dec 2007 22:20:22 +0000 (22:20 +0000)
2-digit precision. This avoids log entries such as

Took 3e-06 seconds (3.5e+03 objects/sec).

This change affects pretty much all debugging output, although most messages
will not change in appearance. Compilation errors are possible. The patch was
posted to squid-dev in August 2007. I do not recall any objections but
apparently I forgot to commit it.

src/debug.cc

index 9390d5147e3ecb1ee86c8c106316f01fa926e646..c707ce80bbc78745a79e00a36c15063db584a20a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: debug.cc,v 1.105 2007/12/02 08:23:56 amosjeffries Exp $
+ * $Id: debug.cc,v 1.106 2007/12/04 15:20:22 rousskov Exp $
  *
  * DEBUG: section 0     Debug Routines
  * AUTHOR: Harvest Derived
@@ -739,6 +739,9 @@ std::ostream &
 Debug::getDebugOut() {
     assert (CurrentDebug == NULL);
     CurrentDebug = new std::ostringstream();
+    // set default formatting flags
+    CurrentDebug->setf(std::ios::fixed);
+    CurrentDebug->precision(2);
     return *CurrentDebug;
 }