11 #ifndef HPP_UTIL_DEBUG_HH 12 # define HPP_UTIL_DEBUG_HH 19 # include <hpp/util/config.hh> 61 HPP_UTIL_DLLAPI std::string
getPrefix (
const std::string& packageName);
72 HPP_UTIL_DLLAPI std::string
getFilename (
const std::string& filename,
73 const std::string& packageName);
95 const std::string& data) = 0;
101 char const*
function,
102 const std::stringstream& data) = 0;
106 writePrefix (std::ostream& stream,
110 char const*
function);
128 explicit Channel (
char const* label,
129 const subscribers_t& subscribers);
132 void write (
char const* file,
134 char const*
function,
135 const std::string& data);
137 void write (
char const* file,
139 char const*
function,
140 const std::stringstream& data);
142 const char* label ()
const;
145 subscribers_t subscribers_;
155 void write (
const Channel& channel,
158 char const*
function,
159 const std::string& data);
161 void write (
const Channel& channel,
164 char const*
function,
165 const std::stringstream& data);
170 std::string filename;
171 std::string lastFunction;
172 std::ofstream stream;
181 void write (
const Channel& channel,
184 char const*
function,
185 const std::string& data);
186 void write (
const Channel& channel,
189 char const*
function,
190 const std::stringstream& data);
242 # define hppDebug(statement) \ 244 using namespace ::hpp::debug; \ 249 # define hppDebugStatement(statement) \ 260 # define hppDout(channel, data) \ 262 using namespace hpp; \ 263 using namespace ::hpp::debug; \ 264 std::stringstream __ss; \ 265 __ss << data << iendl; \ 266 logging.channel.write (__FILE__, __LINE__, __PRETTY_FUNCTION__, \ 273 # define hppDoutFatal(channel, data) \ 275 using namespace hpp; \ 276 using namespace ::hpp::debug; \ 277 std::stringstream __ss; \ 278 __ss << data << iendl; \ 279 logging.channel.write ( __FILE__, __LINE__, __PRETTY_FUNCTION__, \ 281 ::std::exit(EXIT_FAILURE); \ 288 # define hppDebug(statement) \ 291 # define hppDebugStatement(statement) 292 # define hppDout(channel, data) \ 295 # define hppDoutFatal(channel, data) \ 297 using namespace hpp; \ 298 ::std::cerr << data << iendl; \ 299 ::std::exit (EXIT_FAILURE); \
JournalOutput benchmarkJournal
Logs to benchmark journal file (i.e. benchmark.XXX.log).
Definition: debug.hh:205
Definition: assertion.hh:24
Channel info
Technical information and debugging.
Definition: debug.hh:217
Logging in journal file in the logging directory.
Definition: debug.hh:149
std::vector< Output * > subscribers_t
Definition: debug.hh:126
Channel notice
User-oriented information.
Definition: debug.hh:214
HPP_UTIL_DLLAPI std::string getFilename(const std::string &filename, const std::string &packageName)
Compute the path of a file in the logging prefix.
Definition: debug.cc:96
Channel benchmark
Benchmark information.
Definition: debug.hh:220
Debugging output.
Definition: debug.hh:84
Channel warning
Non-fatal problems channel.
Definition: debug.hh:211
Channel error
Fatal problems channel.
Definition: debug.hh:208
HPP_UTIL_DLLAPI Logging logging
Benchmark information.
Definition: debug.cc:309
Logging in console (std::cerr).
Definition: debug.hh:176
Receive debugging information.
Definition: debug.hh:123
JournalOutput journal
Logs to main journal file (i.e. journal.XXX.log).
Definition: debug.hh:203
ConsoleOutput console
Logs to console (i.e. stderr).
Definition: debug.hh:201
Logging class owns all channels and outputs.
Definition: debug.hh:194
HPP_UTIL_DLLAPI std::string getPrefix(const std::string &packageName)
Compute the logging prefix.
Definition: debug.cc:75