Source-highlight Library
/home/bettini/work/source-highlight/src-highlite/lib/srchilite/verbosity.h
00001 /*
00002  * verbosity.h
00003  *
00004  *  Created on: Apr 19, 2009
00005  *      Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2008
00006  *  Copyright: See COPYING file that comes with this distribution
00007  */
00008 
00009 #ifndef VERBOSITY_H_
00010 #define VERBOSITY_H_
00011 
00012 #include <iostream>
00013 
00014 namespace srchilite {
00015 
00022 class Verbosity {
00023     static bool verbosity;
00024 public:
00025     static void setVerbosity(bool b = true) {
00026         verbosity = b;
00027     }
00028     static bool getVerbosity() {
00029         return verbosity;
00030     }
00031 };
00032 
00037 #define VERBOSE(s) if (Verbosity::getVerbosity()) std::cerr << s;
00038 
00043 #define VERBOSELN(s) if (Verbosity::getVerbosity()) std::cerr << s << std::endl;
00044 
00045 }
00046 
00047 #endif /* VERBOSITY_H_ */