hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
logger Namespace Reference

Typedefs

using Logger = std::shared_ptr< spdlog::logger >
 

Functions

std::string red (const std::string &string)
 
std::string yellow (const std::string &string)
 
std::string output (const std::string &string)
 
std::string input (const std::string &string)
 
static void setGlobalPattern (spdlog::logger &logger)
 
static void setDebugPattern (spdlog::logger &logger)
 
static std::shared_ptr< spdlog::logger > createLogger (const std::string &tag, bool debug_mode=true)
 
Logger log (const std::string &tag)
 
Logger testLog (const std::string &tag)
 
std::string boolRepr (bool value)
 
template<typename T >
std::string logBool (T val)
 
template<class Collection , class Lambda >
std::string to_string (const Collection &collection, Lambda transform)
 
template<class Optional , class Lambda >
std::string opt_to_string (const Optional &opt, Lambda transform)
 

Variables

const std::string end = "\033[0m"
 

Detailed Description

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

Typedef Documentation

using logger::Logger = typedef std::shared_ptr<spdlog::logger>

Function Documentation

std::string logger::boolRepr ( bool  value)

Convert bool value to human readable string repr

Parameters
valuevalue for transformation
Returns
"true" or "false"

Here is the caller graph for this function:

static std::shared_ptr<spdlog::logger> logger::createLogger ( const std::string tag,
bool  debug_mode = true 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

std::string logger::input ( const std::string string)

Here is the call graph for this function:

Here is the caller graph for this function:

Logger logger::log ( const std::string tag)

Provide logger object

Parameters
tag- tagging name for identifiing logger
Returns
logger object

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename T >
std::string logger::logBool ( val)

Converts object to bool and provides string repr of it

Template Parameters
T- type of object, T must implement bool operator
Parameters
val- value for convertation
Returns
string representation of bool object

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Optional , class Lambda >
std::string logger::opt_to_string ( const Optional &  opt,
Lambda  transform 
)

Function provide string representation of optional value

Template Parameters
Optional- type of optional
Lambda- function that consume value type and return std::string
Parameters
opt- value wrapped by optional
transform- function that transforming value to std::string
Returns
string repr of value

Here is the call graph for this function:

std::string logger::output ( const std::string string)

Here is the call graph for this function:

std::string logger::red ( const std::string string)

Here is the call graph for this function:

Here is the caller graph for this function:

static void logger::setDebugPattern ( spdlog::logger &  logger)
static

Here is the caller graph for this function:

static void logger::setGlobalPattern ( spdlog::logger &  logger)
static

Here is the caller graph for this function:

Logger logger::testLog ( const std::string tag)

Provide logger for using in test purposes; This logger write data only for console

Parameters
tag- tagging name for identifiing logger
Returns
logger object

Here is the call graph for this function:

template<class Collection , class Lambda >
std::string logger::to_string ( const Collection &  collection,
Lambda  transform 
)

Function provide string representation of collection

Template Parameters
Collection- type should implement for semantic
Lambda- function that transform argument to string
Parameters
collection- bunch of objects
transform- function that convert object to string
Returns
string repr of collection

Here is the call graph for this function:

Here is the caller graph for this function:

std::string logger::yellow ( const std::string string)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const std::string logger::end = "\033[0m"