]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - LogSingleton.h
Suppress bogus free-nonheap-object warning in iniparse.cc
[cygwin-apps/setup.git] / LogSingleton.h
index df5425c815da380b37e35df05eb1f28c29216b76..ffed69dec7f1aacea9909c89aee941190ca06698 100644 (file)
  *
  */
 
-#ifndef   _LOGSINGLETON_H_
-#define   _LOGSINGLETON_H_
+#ifndef SETUP_LOGSINGLETON_H
+#define SETUP_LOGSINGLETON_H
 
-#include "String++.h"
 #include <iostream>
 
 enum log_level {
@@ -26,7 +25,7 @@ enum log_level {
 };
 
 // Logging class. Default logging level is PLAIN.
-class LogSingleton : public ostream
+class LogSingleton : public std::ostream
 {
 public:
   // Singleton support
@@ -37,15 +36,15 @@ public:
    * which guarantees to flush any log data...
    * but doesn't call generic C++ destructors
    */
-  __attribute__ ((noreturn)) virtual void exit (int const exit_code) = 0;
+  __attribute__ ((noreturn)) virtual void exit (int, bool = true) = 0;
   virtual ~LogSingleton();
   // get a specific verbosity stream.
-  virtual ostream &operator() (enum log_level level) = 0;
+  virtual std::ostream &operator() (enum log_level level) = 0;
 
-  friend ostream& endLog(ostream& outs);
+  friend std::ostream& endLog(std::ostream& outs);
   
 protected:
-  LogSingleton(); // Only child classs can be created.
+  LogSingleton(std::streambuf* aStream); // Only child classs can be created.
   LogSingleton (LogSingleton const &); // no copy constructor
   LogSingleton &operator = (LogSingleton const&); // no assignment operator
   virtual void endEntry() = 0; // the current in-progress entry is complete.
@@ -54,8 +53,12 @@ private:
 };
 
 /* End of a Log comment */
-extern ostream& endLog(ostream& outs);
-//extern ostream& endLog(ostream& outs);
+extern std::ostream& endLog(std::ostream& outs);
 
-#define log(X) LogSingleton::GetInstance()(X)
-#endif /* _LOGSINGLETON_H_ */
+#define Log(X) (LogSingleton::GetInstance ()(X))
+
+// Log adapators for printf-style output
+void LogBabblePrintf(const char *fmt, ...);
+void LogPlainPrintf(const char *fmt, ...);
+
+#endif /* SETUP_LOGSINGLETON_H */
This page took 0.024852 seconds and 5 git commands to generate.