MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
print_function.hpp File Reference
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <iomanip>
#include <ctime>
#include <algorithm>
+ Include dependency graph for print_function.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 moose
 

Macros

#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
#define DEBUG_LEVEL   0
 
#define LOG(t, a)   { stringstream __ss__; __ss__ << a; moose::__dump__(__ss__.str(), t ); }
 This macro only expands when not compiling for release. More...
 
#define MOOSE_DEBUG(a)   {}
 
#define T_BLACK   "\033[30m" /* Black */
 
#define T_BLUE   "\033[34m" /* Blue */
 
#define T_BOLDBLACK   "\033[1m\033[30m" /* Bold Black */
 
#define T_BOLDBLUE   "\033[1m\033[34m" /* Bold Blue */
 
#define T_BOLDCYAN   "\033[1m\033[36m" /* Bold Cyan */
 
#define T_BOLDGREEN   "\033[1m\033[32m" /* Bold Green */
 
#define T_BOLDMAGENTA   "\033[1m\033[35m" /* Bold Magenta */
 
#define T_BOLDRED   "\033[1m\033[31m" /* Bold Red */
 
#define T_BOLDWHITE   "\033[1m\033[37m" /* Bold White */
 
#define T_BOLDYELLOW   "\033[1m\033[33m" /* Bold Yellow */
 
#define T_CYAN   "\033[36m" /* Cyan */
 
#define T_GREEN   "\033[32m" /* Green */
 
#define T_MAGENTA   "\033[35m" /* Magenta */
 
#define T_RED   "\033[31m" /* Red */
 
#define T_RESET   "\033[0m"
 
#define T_WHITE   "\033[37m" /* White */
 
#define T_YELLOW   "\033[33m" /* Yellow */
 

Enumerations

enum  moose::serverity_level_ {
  moose::trace, moose::debug, moose::info, moose::warning,
  moose::fixme, moose::error, moose::fatal, moose::failed
}
 Enumerate type for debug and log. More...
 

Functions

void moose::__dump__ (string msg, serverity_level_ type=debug, bool autoFormat=true)
 
string moose::colored (string msg)
 
string moose::colored (string msg, string colorName)
 
string moose::debugPrint (string msg, string prefix="DEBUG", string color=T_RESET, unsigned debugLevel=0)
 
string moose::formattedMsg (string &msg)
 
bool moose::isBackTick (char a)
 
void moose::log (string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true)
 Log to console (and to a log-file) More...
 
template<typename A , typename B >
string moose::mapToString (const map< A, B > &m, bool value=true)
 
void moose::showDebug (const string msg)
 
void moose::showError (string msg)
 
void moose::showInfo (string msg)
 
void moose::showWarn (string msg)
 

Variables

static string moose::levels_ [9]
 

Macro Definition Documentation

#define __FILENAME__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

Macros

Definition at line 61 of file print_function.hpp.

#define DEBUG_LEVEL   0

Definition at line 23 of file print_function.hpp.

Referenced by moose::debugPrint().

#define LOG (   t,
 
)    { stringstream __ss__; __ss__ << a; moose::__dump__(__ss__.str(), t ); }

This macro only expands when not compiling for release.

Parameters
aStream to write to logger /console.
tType of the stream.
Returns
Nothing.

Definition at line 254 of file print_function.hpp.

Referenced by Shell::cleanSimulation(), moose::createParentDirs(), Shell::doLoadModel(), handle_keyboard_interrupts(), MODINIT(), Streamer::reinit(), Table::setFormat(), StreamerBase::writeToCSVFile(), StreamerBase::writeToOutFile(), and Streamer::zipWithTime().

#define MOOSE_DEBUG (   a)    {}
#define T_BLACK   "\033[30m" /* Black */

Definition at line 37 of file print_function.hpp.

#define T_BLUE   "\033[34m" /* Blue */

Definition at line 41 of file print_function.hpp.

#define T_BOLDBLACK   "\033[1m\033[30m" /* Bold Black */

Definition at line 45 of file print_function.hpp.

#define T_BOLDBLUE   "\033[1m\033[34m" /* Bold Blue */

Definition at line 49 of file print_function.hpp.

#define T_BOLDCYAN   "\033[1m\033[36m" /* Bold Cyan */

Definition at line 51 of file print_function.hpp.

#define T_BOLDGREEN   "\033[1m\033[32m" /* Bold Green */

Definition at line 47 of file print_function.hpp.

#define T_BOLDMAGENTA   "\033[1m\033[35m" /* Bold Magenta */

Definition at line 50 of file print_function.hpp.

#define T_BOLDRED   "\033[1m\033[31m" /* Bold Red */

Definition at line 46 of file print_function.hpp.

#define T_BOLDWHITE   "\033[1m\033[37m" /* Bold White */

Definition at line 52 of file print_function.hpp.

#define T_BOLDYELLOW   "\033[1m\033[33m" /* Bold Yellow */

Definition at line 48 of file print_function.hpp.

#define T_CYAN   "\033[36m" /* Cyan */

Definition at line 43 of file print_function.hpp.

Referenced by moose::__dump__().

#define T_GREEN   "\033[32m" /* Green */

Definition at line 39 of file print_function.hpp.

Referenced by moose::__dump__().

#define T_MAGENTA   "\033[35m" /* Magenta */

Definition at line 42 of file print_function.hpp.

Referenced by moose::__dump__().

#define T_RED   "\033[31m" /* Red */

Definition at line 38 of file print_function.hpp.

Referenced by moose::__dump__(), and moose::colored().

#define T_RESET   "\033[0m"

Definition at line 36 of file print_function.hpp.

Referenced by moose::__dump__(), moose::colored(), and moose::debugPrint().

#define T_WHITE   "\033[37m" /* White */

Definition at line 44 of file print_function.hpp.

#define T_YELLOW   "\033[33m" /* Yellow */

Definition at line 40 of file print_function.hpp.

Referenced by moose::__dump__().