usata-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Usata-commits] Changes to usata/src/log.cpp


From: Chong Kai Xiong
Subject: [Usata-commits] Changes to usata/src/log.cpp
Date: Sun, 26 Dec 2004 16:34:46 -0500

Index: usata/src/log.cpp
diff -u usata/src/log.cpp:1.2 usata/src/log.cpp:1.3
--- usata/src/log.cpp:1.2       Mon May 19 19:48:55 2003
+++ usata/src/log.cpp   Wed May 28 20:09:22 2003
@@ -179,18 +179,47 @@
 
       while (current != last)
       {
-         (*current)->commit();
-         current++;
+             (*current)->commit();
+             current++;
       }
   }
 
   void
   logstream::commit ()
   {
-      log_server*server(log_server::instance());
-      server->log(m_level, str(), true);
-      str("");
+      log_server* server(log_server::instance());
+      m_out.clear();
+      server->log(m_level, m_out.str(), true);
+      m_out.str("");
+      for ( unsigned int space=0; 
+            space < m_indent; 
+            space++) 
+      {
+          m_out << ' ';
+      }    
   }
+
     
+  void 
+  logstream::indent(unsigned char spaces)
+  {
+      m_indent_list.push_back(spaces);
+      m_indent += spaces;
+      
+  }
+
+  void 
+  logstream::unindent()
+  {
+      m_indent -= m_indent_list.back();
+      m_indent_list.pop_back();
+  }
+
+  void
+  logstream::clear_indent()
+  {
+      m_indent_list.clear();
+      m_indent = 0;
+  }
 
 };




reply via email to

[Prev in Thread] Current Thread [Next in Thread]