00001 #ifndef cdiAux_H
00002 #define cdiAux_H
00003
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020
00021
00022 #include <string>
00023 #include <owl/time.h>
00024
00025 class cdiAux
00026 {
00027 int verbosity_;
00028 public:
00029
00030 cdiAux( int verbosity = 1 ) : verbosity_(verbosity) { ; }
00031
00032 void info ( const std::string & msg, int verbosity = 1 ) const {
00033 if (verbosity <= verbosity_)
00034 std::cout << "[CDI INFO (" << OWLTime() << ") ] " << msg << std::endl;
00035 }
00036
00037 void warning ( const std::string & msg, int verbosity = 1 ) const {
00038 if (verbosity <= verbosity_)
00039 std::cout << "[CDI WARNING (" << OWLTime() << ") ] " << msg << std::endl;
00040 }
00041
00042 void error ( const std::string & msg, int verbosity = 0 ) const {
00043 if (verbosity <= verbosity_)
00044 std::cout << "[CDI ERROR (" << OWLTime() << ") ] " << msg << std::endl;
00045 }
00046
00047 void debug (const std::string & msg, int verbosity = 2 ) const {
00048 if (verbosity <= verbosity_)
00049 std::cout << "[CDI DEBUG (" << OWLTime() << ") ] " << msg << std::endl;
00050 }
00051
00052 void verbose (const std::string & msg, int verbosity = 3 ) const {
00053 if (verbosity <= verbosity_)
00054 std::cout << "[CDI VERBOSE (" << OWLTime() << ") ] " << msg << std::endl;
00055 }
00056
00057 void verbose (const char*msg, int verbosity = 3 ) const {
00058 this->verbose(std::string(msg),verbosity);
00059 }
00060 void debug (const char*msg, int verbosity = 2 ) const {
00061 this->debug(std::string(msg),verbosity);
00062 }
00063 void error (const char*msg, int verbosity = 0 ) const {
00064 this->error(std::string(msg),verbosity);
00065 }
00066 void info (const char*msg, int verbosity = 1 ) const {
00067 this->info(std::string(msg),verbosity);
00068 }
00069
00070 void warning (const char*msg, int verbosity = 1 ) const {
00071 this->warning(std::string(msg),verbosity);
00072 }
00073
00074 };
00075
00076 #endif //cdiAux_H