- /// This is a global flag that controls whether any debug, warning
- /// messages are displayed.
- static int GetDebugFlag ();
- static void SetDebugFlag (int flag);
- static void SetDebugOn () { SetDebugFlag(1); };
- static void SetDebugOff () { SetDebugFlag(0); };
+ Debug();
+ ~Debug();
+
+ /// \brief This is a global flag that controls whether
+ /// both debug and warning messages are displayed.
+ /// (used to warn user when file contains some oddity)
+ static void SetDebugFlag (bool flag);
+ /// \brief Gets the debug flag value
+ static bool GetDebugFlag () {return DebugFlag;}
+ /// \brief Sets the Debug Flag to true
+ static void DebugOn () { SetDebugFlag(true); }
+ /// \brief Sets the Debug Flag to false
+ static void DebugOff () { SetDebugFlag(false); }
+
+ /// \brief This is a global flag that controls whether
+ /// warning messages are displayed.
+ static void SetWarningFlag (bool flag);
+ /// \brief Gets the warning flag value
+ static bool GetWarningFlag () {return WarningFlag;}
+ /// \brief Sets the Warning Flag to true
+ static void WarningOn () { SetWarningFlag(true); }
+ /// \brief Sets the Warning Flag to false
+ static void WarningOff () { SetWarningFlag(false); }
+
+ /// \brief This is a global flag that controls if debug are redirected
+ /// to a file or not
+ static void SetOutputToFile (bool flag);
+ static bool GetOutputToFile ();
+ /// \brief Next debug messages will be sent in the debug file
+ static void OutputToFileOn () { SetOutputToFile(true); }
+ /// \brief Next debug messages will be sent in the standard output
+ static void OutputToFileOff () { SetOutputToFile(false); }
+
+ static void SetOutputFileName (std::string const &filename);
+
+ static std::ostream &GetOutput ();
+
+ static void SendToOutput(unsigned int type,std::string const &msg,const Base *object = NULL);
+
+private:
+ static bool DebugFlag;
+ static bool WarningFlag;
+ static bool OutputToFile;
+
+ static std::ofstream OutputFileStream;
+ static std::ostream &StandardStream;
+
+ static const int LINE_LENGTH;