Improve homogeneity of rsdebug

Offer variadic style macros also for RsInfo...RsFatal
This commit is contained in:
Gioacchino Mazzurco 2020-06-09 16:10:07 +02:00
parent 680d9cde85
commit f99a8a0fc6
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -149,6 +149,7 @@ RS_DBG4("Hello 4 ", "my debug ", my_variable) << " message " << variable2;
* this, so we suggest to use variadic style for debug messages.
*/
using RsDbg = t_RsLogger<RsLoggerCategories::DEBUG>;
#define RS_DBG(...) RsDbg(__PRETTY_FUNCTION__, " ", __VA_ARGS__)
/**
* Comfortable log information reporting helper, supports chaining like
@ -159,16 +160,20 @@ RsInfo() << __PRETTY_FUNCTION__ << "My information message" << std::cerr;
@endcode
*/
using RsInfo = t_RsLogger<RsLoggerCategories::INFO>;
#define RS_INFO(...) RsInfo(__PRETTY_FUNCTION__, " ", __VA_ARGS__)
/// Similar to @see RsInfo but for warning messages
using RsWarn = t_RsLogger<RsLoggerCategories::WARNING>;
#define RS_WARN(...) RsWarn(__PRETTY_FUNCTION__, " ", __VA_ARGS__)
/// Similar to @see RsInfo but for error messages
using RsErr = t_RsLogger<RsLoggerCategories::ERROR>;
#define RS_ERR(...) RsErr(__PRETTY_FUNCTION__, " ", __VA_ARGS__)
/** Similar to @see RsInfo but for fatal errors (the ones which cause RetroShare
* to terminate) messages */
using RsFatal = t_RsLogger<RsLoggerCategories::FATAL>;
#define RS_FATAL(...) RsFatal(__PRETTY_FUNCTION__, " ", __VA_ARGS__)
/**