From 7a51b73680ed1a7caf665074d16a90754dcfeb07 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 19 Jun 2014 11:19:22 -0400 Subject: [PATCH] adding ulog to send messages to the user log stream --- include/fc/log/logger.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/fc/log/logger.hpp b/include/fc/log/logger.hpp index be87964..d456f8b 100644 --- a/include/fc/log/logger.hpp +++ b/include/fc/log/logger.hpp @@ -97,6 +97,18 @@ namespace fc } \ } while (0) +/** + * Sends the log message to a special 'user' log stream designed for messages that + * the end user may like to see. + */ +#define ulog( FORMAT, ... ) \ + do { \ + if( (fc::logger::get("user")).is_enabled( fc::log_level::debug ) ) { \ + (fc::logger::get("user")).log( FC_LOG_MESSAGE( debug, FORMAT, __VA_ARGS__ ) ); \ + } \ + } while (0) + + #define ilog( FORMAT, ... ) \ do { \ if( (fc::logger::get(DEFAULT_LOGGER)).is_enabled( fc::log_level::info ) ) { \