26 #include <boost/log/attributes/scoped_attribute.hpp>
27 #include <boost/log/sources/global_logger_storage.hpp>
28 #include <boost/log/sources/record_ostream.hpp>
29 #include <boost/log/sources/severity_channel_logger.hpp>
78 boost::log::sources::severity_channel_logger_mt<>,
79 (boost::log::keywords::severity =
VerbosityError)(boost::log::keywords::channel =
"error"))
80 #define cerror LOG(dev::g_errorLogger::get())
83 boost::log::sources::severity_channel_logger_mt<>,
84 (boost::log::keywords::severity =
VerbosityWarning)(boost::log::keywords::channel =
"warn"))
85 #define cwarn LOG(dev::g_warnLogger::get())
88 boost::log::sources::severity_channel_logger_mt<>,
89 (boost::log::keywords::severity =
VerbosityInfo)(boost::log::keywords::channel =
"info"))
90 #define cnote LOG(dev::g_noteLogger::get())
93 boost::log::sources::severity_channel_logger_mt<>,
94 (boost::log::keywords::severity =
VerbosityDebug)(boost::log::keywords::channel =
"debug"))
95 #define cdebug LOG(dev::g_debugLogger::get())
98 boost::log::sources::severity_channel_logger_mt<>,
99 (boost::log::keywords::severity =
VerbosityTrace)(boost::log::keywords::channel =
"trace"))
100 #define ctrace LOG(dev::g_traceLogger::get())
105 BOOST_LOG_INLINE_GLOBAL_LOGGER_DEFAULT(
106 g_clogLogger, boost::log::sources::severity_channel_logger_mt<>)
107 #define clog(SEVERITY, CHANNEL) \
108 BOOST_LOG_STREAM_WITH_PARAMS(dev::g_clogLogger::get(), \
109 (boost::log::keywords::severity = SEVERITY)(boost::log::keywords::channel = CHANNEL))
112 struct LoggingOptions
124 using Logger = boost::log::sources::severity_channel_logger<>;
128 boost::log::keywords::severity = _severity, boost::log::keywords::channel = _channel);
132 #define LOG_SCOPED_CONTEXT(context) \
133 BOOST_LOG_SCOPED_THREAD_ATTR("Context", boost::log::attributes::constant<std::string>(context));
140 boost::log::formatting_ostream& _strm,
bigint const& _value)
146 boost::log::formatting_ostream& _strm,
bigint& _value)
148 auto const& constValue = _value;
154 boost::log::formatting_ostream& _strm,
u256 const& _value)
160 boost::log::formatting_ostream& _strm,
u256& _value)
162 auto const& constValue = _value;
168 boost::log::formatting_ostream& _strm,
u160 const& _value)
174 boost::log::formatting_ostream& _strm,
u160& _value)
176 auto const& constValue = _value;
181 template <
unsigned N>
183 boost::log::formatting_ostream& _strm,
FixedHash<N> const& _value)
188 template <
unsigned N>
190 boost::log::formatting_ostream& _strm,
FixedHash<N>& _value)
192 auto const& constValue = _value;
198 boost::log::formatting_ostream& _strm,
h160 const& _value)
204 boost::log::formatting_ostream& _strm,
h160& _value)
206 auto const& constValue = _value;
212 boost::log::formatting_ostream& _strm,
h256 const& _value)
218 boost::log::formatting_ostream& _strm,
h256& _value)
220 auto const& constValue = _value;
226 boost::log::formatting_ostream& _strm,
h512 const& _value)
232 boost::log::formatting_ostream& _strm,
h512& _value)
234 auto const& constValue = _value;
255 boost::log::formatting_ostream& _strm,
dev::bytes const& _value)
261 boost::log::formatting_ostream& _strm,
dev::bytes& _value)
263 auto const& constValue = _value;
268 template <
typename T>
270 boost::log::formatting_ostream& _strm, std::vector<T>
const& _value)
274 for (T
const& i : _value)
282 template <
typename T>
284 boost::log::formatting_ostream& _strm, std::vector<T>& _value)
286 auto const& constValue = _value;
291 template <
typename T>
293 boost::log::formatting_ostream& _strm, std::set<T>
const& _value)
297 for (T
const& i : _value)
305 template <
typename T>
307 boost::log::formatting_ostream& _strm, std::set<T>& _value)
309 auto const& constValue = _value;
314 template <
typename T>
316 boost::log::formatting_ostream& _strm, std::unordered_set<T>
const& _value)
320 for (T
const& i : _value)
328 template <
typename T>
330 boost::log::formatting_ostream& _strm, std::unordered_set<T>& _value)
332 auto const& constValue = _value;
337 template <
typename T,
typename U>
339 boost::log::formatting_ostream& _strm, std::map<T, U>
const& _value)
343 for (
auto const& i : _value)
353 template <
typename T,
typename U>
355 boost::log::formatting_ostream& _strm, std::map<T, U>& _value)
357 auto const& constValue = _value;
362 template <
typename T,
typename U>
364 boost::log::formatting_ostream& _strm, std::unordered_map<T, U>
const& _value)
368 for (
auto const& i : _value)
378 template <
typename T,
typename U>
380 boost::log::formatting_ostream& _strm, std::unordered_map<T, U>& _value)
382 auto const& constValue = _value;
387 template <
typename T,
typename U>
389 boost::log::formatting_ostream& _strm, std::pair<T, U>
const& _value)
392 _strm << _value.first;
394 _strm << _value.second;
398 template <
typename T,
typename U>
400 boost::log::formatting_ostream& _strm, std::pair<T, U>& _value)
402 auto const& constValue = _value;