forked from mixbytes/haya
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
81 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
plugins/randpa_plugin/include/eosio/randpa_plugin/randpa_logger.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#pragma once | ||
|
||
namespace randpa_finality { | ||
|
||
const fc::string randpa_logger_name("randpa_plugin"); | ||
fc::logger randpa_logger; | ||
|
||
#define randpa_dlog(FORMAT, ...) \ | ||
FC_MULTILINE_MACRO_BEGIN \ | ||
if (randpa_logger.is_enabled(fc::log_level::debug)) \ | ||
randpa_logger.log(FC_LOG_MESSAGE(debug, FORMAT, __VA_ARGS__)); \ | ||
FC_MULTILINE_MACRO_END | ||
|
||
#define randpa_ilog(FORMAT, ...) \ | ||
FC_MULTILINE_MACRO_BEGIN \ | ||
if (randpa_logger.is_enabled(fc::log_level::info)) \ | ||
randpa_logger.log(FC_LOG_MESSAGE(info, FORMAT, __VA_ARGS__)); \ | ||
FC_MULTILINE_MACRO_END | ||
|
||
#define randpa_wlog(FORMAT, ...) \ | ||
FC_MULTILINE_MACRO_BEGIN \ | ||
if (randpa_logger.is_enabled(fc::log_level::warn)) \ | ||
randpa_logger.log(FC_LOG_MESSAGE(warn, FORMAT, __VA_ARGS__)); \ | ||
FC_MULTILINE_MACRO_END | ||
|
||
#define randpa_elog(FORMAT, ...) \ | ||
FC_MULTILINE_MACRO_BEGIN \ | ||
if (randpa_logger.is_enabled(fc::log_level::error)) \ | ||
randpa_logger.log( FC_LOG_MESSAGE(error, FORMAT, __VA_ARGS__)); \ | ||
FC_MULTILINE_MACRO_END | ||
} // randpa_finality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters