Debug.cpp
From Giona
(Difference between revisions)
Line 1: | Line 1: | ||
<pre> | <pre> | ||
+ | |||
+ | /**************************************************************************** | ||
+ | *This class implements the debugging tool. | ||
+ | *Author: Rosario Marino | ||
+ | ***************************************************************************/ | ||
+ | |||
+ | #include "Debug.h" | ||
+ | |||
+ | |||
+ | /* | ||
+ | * Sets the debug mode ON | ||
+ | */ | ||
+ | void Debug::setDebugOn() | ||
+ | { | ||
+ | std::cout << "DEBUG MODE IS ON" <<std::endl; | ||
+ | debug_on=true; | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | * Sets the debug mode OFF | ||
+ | */ | ||
+ | void Debug::setDebugOff() | ||
+ | { | ||
+ | debug_on=false; | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | * Debug message on console | ||
+ | */ | ||
+ | void Debug::debug(STRING txt) | ||
+ | { | ||
+ | if(debug_on) | ||
+ | { | ||
+ | std::cout << "dbg: " << time(0) << " -> " << txt << std::endl; | ||
+ | } | ||
+ | } | ||
Revision as of 16:51, 13 December 2007
/**************************************************************************** *This class implements the debugging tool. *Author: Rosario Marino ***************************************************************************/ #include "Debug.h" /* * Sets the debug mode ON */ void Debug::setDebugOn() { std::cout << "DEBUG MODE IS ON" <<std::endl; debug_on=true; } /* * Sets the debug mode OFF */ void Debug::setDebugOff() { debug_on=false; } /* * Debug message on console */ void Debug::debug(STRING txt) { if(debug_on) { std::cout << "dbg: " << time(0) << " -> " << txt << std::endl; } }