Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

Debug.cpp

00001 /*************************************************************************** 00002 * This file is part of OpenCAL: Open Computer Animation Library * 00003 * I created OpenCAL as my master's thesis Computer Science (multimedia) * 00004 * at the tUL university in Diepenbeek, Belgium * 00005 * * 00006 * Copyright (C) 2003-2004 by Jeroen Dierckx * 00007 * jeroen.dierckx@student.luc.ac.be * 00008 * * 00009 ***************************************************************************/ 00010 00011 // Includes 00012 #include "Debug.h" 00013 using namespace OpenCAL; 00014 00015 using namespace std; 00016 00017 00018 // Define static members 00019 unsigned int Debug::m_debugLevel = 1; 00020 ostringstream Debug::stream; 00021 unsigned int Debug::maxLevel = 10; 00022 00023 00024 /****************** 00025 * Other functions * 00026 ******************/ 00027 00028 void Debug::print(const string &message, unsigned int debugLevel) 00029 { 00030 if(debugLevel > m_debugLevel) return; 00031 00032 cerr << message << endl; 00033 } 00034 00035 void Debug::printStream(unsigned int debugLevel) 00036 { 00037 if(debugLevel <= m_debugLevel) 00038 ;//cerr << stream.str(); 00039 00040 stream.str() = '\0'; 00041 stream.clear(); 00042 } 00043 00044 void Debug::initWarning(const string &className, unsigned int debugLevel) 00045 { 00046 if(debugLevel > m_debugLevel) return; 00047 00048 stream << "The " << className << " isn't initialized yet. "; 00049 stream << "Doing that first..." << endl; 00050 stream << "You know, it is a really good idea "; 00051 stream << "to do this in your initialisation phase!" << endl; 00052 00053 printStream(debugLevel); 00054 }

Generated on Sun Aug 15 19:19:22 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8