Kagome
Polkadot Runtime Engine in C++17
kagome::log Namespace Reference

Classes

class  Configurator
 

Typedefs

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

Enumerations

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

Functions

outcome::result< Levelstr2lvl (std::string_view str)
 
void setLoggingSystem (std::shared_ptr< soralog::LoggingSystem > logging_system)
 
void tuneLoggingSystem (const std::vector< std::string > &cfg)
 
Logger createLogger (const std::string &tag)
 
Logger createLogger (const std::string &tag, const std::string &group)
 
Logger createLogger (const std::string &tag, const std::string &group, Level level)
 
bool setLevelOfGroup (const std::string &group_name, Level level)
 
bool resetLevelOfGroup (const std::string &group_name)
 
bool setLevelOfLogger (const std::string &logger_name, Level level)
 
bool resetLevelOfLogger (const std::string &logger_name)
 
static const std::string defaultGroupName ("kagome")
 
template<typename T , typename Ret >
Ret format_arg (T const &t)
 
template<typename T >
auto format_arg (T const *t)
 
std::string_view format_arg (std::string_view s)
 
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
T const & 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 format_arg (T const &buffer)
 
template<typename T >
auto format_arg (std::reference_wrapper< T > t)
 
template<typename T >
auto format_arg (const std::optional< T > &t)
 
template<typename Ret , typename... Args>
void trace_function_call (Logger const &logger, std::string_view func_name, Ret &&ret, Args &&...args)
 
template<typename... Args>
void trace_void_function_call (Logger const &logger, std::string_view func_name, Args &&...args)
 

Variables

Logger profiling_logger = nullptr
 

Detailed Description

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Typedef Documentation

using kagome::log::Level = typedef soralog::Level

Definition at line 22 of file logger.hpp.

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

Definition at line 23 of file logger.hpp.

Enumeration Type Documentation

enum kagome::log::Error : uint8_t
strong
Enumerator
WRONG_LEVEL 
WRONG_GROUP 
WRONG_LOGGER 

Definition at line 25 of file logger.hpp.

Function Documentation

Logger kagome::log::createLogger ( const std::string &  tag)

Definition at line 112 of file logger.cpp.

Logger kagome::log::createLogger ( const std::string &  tag,
const std::string &  group 
)

Definition at line 118 of file logger.cpp.

Logger kagome::log::createLogger ( const std::string &  tag,
const std::string &  group,
Level  level 
)

Definition at line 124 of file logger.cpp.

static const std::string kagome::log::defaultGroupName ( "kagome"  )
static
template<typename T , typename Ret >
Ret kagome::log::format_arg ( T const &  t)

Definition at line 51 of file logger.hpp.

template<typename T >
auto kagome::log::format_arg ( T const *  t)

Definition at line 56 of file logger.hpp.

std::string_view kagome::log::format_arg ( std::string_view  s)
inline

Definition at line 59 of file logger.hpp.

template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
T const& kagome::log::format_arg ( T const &  arg)

Definition at line 64 of file logger.hpp.

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)

Definition at line 72 of file logger.hpp.

template<typename T >
auto kagome::log::format_arg ( std::reference_wrapper< T >  t)

Definition at line 88 of file logger.hpp.

template<typename T >
auto kagome::log::format_arg ( const std::optional< T > &  t)

Definition at line 93 of file logger.hpp.

bool kagome::log::resetLevelOfGroup ( const std::string &  group_name)

Definition at line 136 of file logger.cpp.

bool kagome::log::resetLevelOfLogger ( const std::string &  logger_name)

Definition at line 145 of file logger.cpp.

bool kagome::log::setLevelOfGroup ( const std::string &  group_name,
Level  level 
)

Definition at line 132 of file logger.cpp.

bool kagome::log::setLevelOfLogger ( const std::string &  logger_name,
Level  level 
)

Definition at line 141 of file logger.cpp.

void kagome::log::setLoggingSystem ( std::shared_ptr< soralog::LoggingSystem >  logging_system)

Definition at line 63 of file logger.cpp.

outcome::result< Level > kagome::log::str2lvl ( std::string_view  str)

Definition at line 41 of file logger.cpp.

template<typename Ret , typename... Args>
void kagome::log::trace_function_call ( Logger const &  logger,
std::string_view  func_name,
Ret &&  ret,
Args &&...  args 
)

Definition at line 98 of file logger.hpp.

template<typename... Args>
void kagome::log::trace_void_function_call ( Logger const &  logger,
std::string_view  func_name,
Args &&...  args 
)

Definition at line 120 of file logger.hpp.

void kagome::log::tuneLoggingSystem ( const std::vector< std::string > &  cfg)

Definition at line 71 of file logger.cpp.

Variable Documentation

Logger kagome::log::profiling_logger = nullptr

Definition at line 9 of file profiling_logger.cpp.