[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    icecream/services
From:       Stephan Kulow <coolo () kde ! org>
Date:       2006-09-02 16:34:37
Message-ID: 1157214877.779805.24179.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 580093 by coolo:

merge in an easy hunk from make-it-cool


 M  +4 -19     logging.h  


--- trunk/icecream/services/logging.h #580092:580093
@@ -44,23 +44,7 @@
     char *buf = ctime( &t );
     buf[strlen( buf )-1] = 0;
     os << "[" << buf << "] ";
-    return os;
-}
-
-inline std::ostream & output_mdate( std::ostream &os )
-{
-   static struct timeval tps;
-   static bool inited = false;
-   if (!inited) 
-   {
-	gettimeofday(&tps, 0);
-	inited = true;
-   }	
-   
-   struct timeval tp;
-   gettimeofday(&tp, 0);
-   os << "[" << tp.tv_sec << ":" << tp.tv_usec << "(" << (tp.tv_sec - tps.tv_sec) * \
                1000 + (tp.tv_usec - tps.tv_usec  + 500 ) / 1000 << ")] ";
-   tps = tp;
+    os << " " << getpid() << ": " ;
    return os;
 }
 
@@ -74,6 +58,7 @@
     return output_date( *logfile_warning );
 }
 
+
 static inline std::ostream& log_error() {
     if(!logfile_error) return std::cerr;
     return output_date( *logfile_error );
@@ -102,7 +87,7 @@
         for (unsigned i = 0; i < nesting; ++i) 
             log_info() << "  "; 
 
-        log_info() << "  <" << (label ? label : "") << ">\n";
+        log_info() << getpid() << "  <" << (label ? label : "") << ">\n";
 
         m_label = strdup(label ? label : "");
         ++nesting;
@@ -119,7 +104,7 @@
         --nesting;
         for (unsigned i = 0; i < nesting; ++i) 
             log_info() << "  "; 
-        log_info() << "  </" << m_label << ": "
+        log_info() << getpid() << "  </" << m_label << ": "
             << (end.tv_sec - m_start.tv_sec ) * 1000 + ( end.tv_usec - \
m_start.tv_usec ) / 1000 << "ms>\n";  
         free(m_label);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic