32#include <source_location>
65 static constexpr int level = 0;
78 static constexpr int level = 1;
91 static constexpr int level = 2;
111 static constexpr int level = 3;
141template <
class verboseT>
143 const std::string &expl,
145 const std::source_location &loc
146 = std::source_location::current() );
190template <
class verboseT>
192 const std::source_location &loc
193 = std::source_location::current() );
238template <
class verboseT>
240 const std::string &expl,
242 const std::source_location &loc
243 = std::source_location::current() )
245 if( verboseT::level > 0 )
247 std::cerr << mxlib_error_message<verboseT>( code, expl, loc ) <<
'\n';
270template <
class verboseT>
272 const std::source_location &loc
273 = std::source_location::current() )
275 if( verboseT::level > 0 )
277 std::cerr << mxlib_error_message<verboseT>( code, loc ) <<
'\n';
302template <
class verboseT>
304 const std::string &expl,
306 const std::source_location &loc
307 = std::source_location::current() );
347template <
class verboseT>
349 const std::source_location &loc
350 = std::source_location::current() );
393template <
class verboseT>
395 const std::string &expl,
397 const std::source_location &loc
398 = std::source_location::current() )
400 if( verboseT::level > 0 )
402 std::cerr << error_message<verboseT>( code, expl, loc ) <<
'\n';
424template <
class verboseT>
426 const std::source_location &loc
427 = std::source_location::current() )
429 if( verboseT::level > 0 )
431 std::cerr << error_message<verboseT>( code, loc ) <<
'\n';
The mxlib error_t type and utilities.
error_t
The mxlib error codes.
std::string error_message< verbose::v >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of error_message for verbose::v.
std::string error_message< verbose::vv >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of error_message for verbose::vv.
error_t error_report< verbose::o >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of error_report for verbose::o.
std::string error_message< verbose::o >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of error_message for verbose::o.
error_t error_report(const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
Print a report to stderr given an mxlib error_t code and explanation and return the code.
std::string error_message(const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
Format a report given an mxlib error_t code and explanation.
std::string error_message< verbose::vvv >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of error_message for verbose::vvv.
error_t mxlib_error_report(const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
Print a report to stderr given an mxlib error_t code and explanation and return the code.
std::string mxlib_error_message< verbose::v >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of mxlib_error_message for verbose::v.
std::string mxlib_error_message< verbose::o >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of mxlib_error_message for verbose::o.
std::string mxlib_error_message< verbose::vv >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of mxlib_error_message for verbose::vv.
std::string mxlib_error_message< verbose::vvv >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of mxlib_error_message for verbose::vvv.
error_t mxlib_error_report< verbose::o >(const error_t &code, const std::string &expl, const std::source_location &loc)
Specialization of mxlib_error_report for verbose::o.
std::string mxlib_error_message(const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
Format a report given an mxlib error_t code and explanation.
Old version. Deprecated. Declares and defines the mxlib error reporting system.
Verbosity level 0, no reports are generated or printed to stderr.
Verbosity level 1. Minimal reports with no source location information.
Verbosity level 2. Additional information is provided, including source file and line.
Verbosity level 3. A full report is provided.