34 #ifndef HPP_UTIL_DEBUG_HH 35 #define HPP_UTIL_DEBUG_HH 90 const std::string& packageName);
106 virtual void write(
const Channel& channel,
char const* file,
int line,
107 char const*
function,
const std::string& data) = 0;
109 virtual void write(
const Channel& channel,
char const* file,
int line,
110 char const*
function,
const std::stringstream& data) = 0;
113 std::ostream& writePrefix(std::ostream& stream,
const Channel& channel,
114 char const* file,
int line,
char const*
function);
131 explicit Channel(
char const* label,
const subscribers_t& subscribers);
134 void write(
char const* file,
int line,
char const*
function,
135 const std::string& data);
137 void write(
char const* file,
int line,
char const*
function,
138 const std::stringstream& data);
140 const char* label()
const;
144 subscribers_t subscribers_;
153 void write(
const Channel& channel,
char const* file,
int line,
154 char const*
function,
const std::string& data);
156 void write(
const Channel& channel,
char const* file,
int line,
157 char const*
function,
const std::stringstream& data);
162 std::string filename;
163 std::string lastFunction;
164 std::ofstream stream;
172 void write(
const Channel& channel,
char const* file,
int line,
173 char const*
function,
const std::string& data);
174 void write(
const Channel& channel,
char const* file,
int line,
175 char const*
function,
const std::stringstream& data);
222 #define hppDebug(statement) \ 224 using namespace ::hpp::debug; \ 229 #define hppDebugStatement(statement) statement 240 #define hppDout(channel, data) \ 242 using namespace hpp; \ 243 using namespace ::hpp::debug; \ 244 std::stringstream __ss; \ 245 __ss << data << iendl; \ 246 logging.channel.write(__FILE__, __LINE__, __PRETTY_FUNCTION__, __ss); \ 253 #define hppDoutFatal(channel, data) \ 255 using namespace hpp; \ 256 using namespace ::hpp::debug; \ 257 std::stringstream __ss; \ 258 __ss << data << iendl; \ 259 logging.channel.write(__FILE__, __LINE__, __PRETTY_FUNCTION__, __ss); \ 260 ::std::exit(EXIT_FAILURE); \ 267 #define hppDebug(statement) \ 270 #define hppDebugStatement(statement) 271 #define hppDout(channel, data) \ 274 #define hppDoutFatal(channel, data) \ 276 using namespace hpp; \ 277 ::std::cerr << data << iendl; \ 278 ::std::exit(EXIT_FAILURE); \
JournalOutput benchmarkJournal
Logs to benchmark journal file (i.e. benchmark.XXX.log).
Definition: debug.hh:189
Definition: assertion.hh:45
Channel info
Technical information and debugging.
Definition: debug.hh:201
Logging in journal file in the logging directory.
Definition: debug.hh:148
std::vector< Output * > subscribers_t
Definition: debug.hh:129
Channel notice
User-oriented information.
Definition: debug.hh:198
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:89
Channel benchmark
Benchmark information.
Definition: debug.hh:204
Debugging output.
Definition: debug.hh:101
#define HPP_UTIL_DLLAPI
Definition: config.hh:64
Channel warning
Non-fatal problems channel.
Definition: debug.hh:195
Channel error
Fatal problems channel.
Definition: debug.hh:192
HPP_UTIL_DLLAPI Logging logging
Benchmark information.
Definition: debug.cc:225
Logging in console (std::cerr).
Definition: debug.hh:168
Receive debugging information.
Definition: debug.hh:127
JournalOutput journal
Logs to main journal file (i.e. journal.XXX.log).
Definition: debug.hh:187
ConsoleOutput console
Logs to console (i.e. stderr).
Definition: debug.hh:185
Logging class owns all channels and outputs.
Definition: debug.hh:179
HPP_UTIL_DLLAPI std::string getPrefix(const std::string &packageName)
Compute the logging prefix.
Definition: debug.cc:72