]> granicus.if.org Git - pdns/commitdiff
fix up the logger so it can log unsigned integers, for serial numbers
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 13 Sep 2004 19:00:03 +0000 (19:00 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 13 Sep 2004 19:00:03 +0000 (19:00 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@252 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/logger.cc
pdns/logger.hh

index 966639c7dabc964d9504484330ed3ac3464dd605..a63c4b312645ecdd4bbe2e809379513dbbea54f7 100644 (file)
@@ -121,6 +121,17 @@ Logger& Logger::operator<<(int i)
   return *this;
 }
 
+Logger& Logger::operator<<(unsigned int i)
+{
+  ostringstream tmp;
+  tmp<<i;
+
+  *this<<tmp.str();
+
+  return *this;
+}
+
+
 Logger& Logger::operator<<(ostream & (&)(ostream &))
 {
   // *this<<" ("<<(int)d_outputurgencies[pthread_self()]<<", "<<(int)consoleUrgency<<")";
index 80393c7767e023513ff23a225c0809bc34f81876..614b4817f35b435a9500317b77f183d3c6c5cecf 100644 (file)
@@ -110,6 +110,7 @@ public:
   */
   Logger& operator<<(const string &s);   //!< log a string
   Logger& operator<<(int);   //!< log an int
+  Logger& operator<<(unsigned int);   //!< log an unsigned int
   Logger& operator<<(Urgency);    //!< set the urgency, << style
 
 #ifndef WIN32