Kagome
Polkadot Runtime Engine in C++17
logger.hpp File Reference
#include <sstream>
#include <boost/assert.hpp>
#include <optional>
#include <soralog/level.hpp>
#include <soralog/logger.hpp>
#include <soralog/logging_system.hpp>
#include <soralog/macro.hpp>
#include "common/hexutil.hpp"
Include dependency graph for logger.hpp:

Go to the source code of this file.

Namespaces

 kagome::log
 

Macros

#define SL_TRACE_FUNC_CALL(logger, ret, ...)
 
#define SL_TRACE_VOID_FUNC_CALL(logger, ...)   ::kagome::log::trace_void_function_call((logger), __FUNCTION__, ##__VA_ARGS__)
 

Typedefs

using kagome::log::Level = soralog::Level
 
using kagome::log::Logger = std::shared_ptr< soralog::Logger >
 

Enumerations

enum  kagome::log::Error : uint8_t { kagome::log::Error::WRONG_LEVEL = 1, kagome::log::Error::WRONG_GROUP, kagome::log::Error::WRONG_LOGGER }
 

Functions

outcome::result< Level > kagome::log::str2lvl (std::string_view str)
 
void kagome::log::setLoggingSystem (std::shared_ptr< soralog::LoggingSystem > logging_system)
 
void kagome::log::tuneLoggingSystem (const std::vector< std::string > &cfg)
 
static const std::string kagome::log::defaultGroupName ("kagome")
 
Logger kagome::log::createLogger (const std::string &tag)
 
Logger kagome::log::createLogger (const std::string &tag, const std::string &group)
 
Logger kagome::log::createLogger (const std::string &tag, const std::string &group, Level level)
 
bool kagome::log::setLevelOfGroup (const std::string &group_name, Level level)
 
bool kagome::log::resetLevelOfGroup (const std::string &group_name)
 
bool kagome::log::setLevelOfLogger (const std::string &logger_name, Level level)
 
bool kagome::log::resetLevelOfLogger (const std::string &logger_name)
 
template<typename T , typename Ret >
Ret kagome::log::format_arg (T const &t)
 
template<typename T >
auto kagome::log::format_arg (T const *t)
 
std::string_view kagome::log::format_arg (std::string_view s)
 
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
T const & kagome::log::format_arg (T const &arg)
 
template<typename T , typename = std::enable_if_t<std::is_same_v< std::decay_t<decltype(*std::declval<T>().begin())>, uint8_t>>>
std::string kagome::log::format_arg (T const &buffer)
 
template<typename T >
auto kagome::log::format_arg (std::reference_wrapper< T > t)
 
template<typename T >
auto kagome::log::format_arg (const std::optional< T > &t)
 
template<typename Ret , typename... Args>
void kagome::log::trace_function_call (Logger const &logger, std::string_view func_name, Ret &&ret, Args &&...args)
 
template<typename... Args>
void kagome::log::trace_void_function_call (Logger const &logger, std::string_view func_name, Args &&...args)
 
 OUTCOME_HPP_DECLARE_ERROR (kagome::log, Error)
 

Macro Definition Documentation

#define SL_TRACE_FUNC_CALL (   logger,
  ret,
  ... 
)
Value:
(logger), __FUNCTION__, (ret), ##__VA_ARGS__)
void trace_function_call(Logger const &logger, std::string_view func_name, Ret &&ret, Args &&...args)
Definition: logger.hpp:98

Definition at line 142 of file logger.hpp.

#define SL_TRACE_VOID_FUNC_CALL (   logger,
  ... 
)    ::kagome::log::trace_void_function_call((logger), __FUNCTION__, ##__VA_ARGS__)

Definition at line 146 of file logger.hpp.

Function Documentation

OUTCOME_HPP_DECLARE_ERROR ( kagome::log  ,
Error   
)