Support Class Library
A set of tools providing classes and utility
Functions
scl::tools::iostream::log::surrounded Namespace Reference

Logging utils but with both prefix and suffix. More...

Functions

template<class T = std::string>
std::function< decltype(std::cout)&(const T &)> log (const char *const prefix, const char *const suffix)
 Log on stdout with a prefix and a suffix, end with a line break. More...
 
template<class T = std::string>
std::function< decltype(std::cerr)&(const T &)> error (const char *const prefix, const char *const suffix)
 Log on stderr with a prefix and a suffix, end with a line break. More...
 

Detailed Description

Logging utils but with both prefix and suffix.

Function Documentation

◆ error()

template<class T = std::string>
std::function<decltype(std::cerr)&(const T&)> scl::tools::iostream::log::surrounded::error ( const char *const  prefix,
const char *const  suffix 
)
inline

Log on stderr with a prefix and a suffix, end with a line break.

Template Parameters
Tbeing the type of objects to log
Parameters
prefixbeing the logging prefix
suffixbeing the logging suffix
Returns
a logging function that uses both prefix and suffix

Definition at line 43 of file surrounded.h.

◆ log()

template<class T = std::string>
std::function<decltype(std::cout)&(const T&)> scl::tools::iostream::log::surrounded::log ( const char *const  prefix,
const char *const  suffix 
)
inline

Log on stdout with a prefix and a suffix, end with a line break.

Template Parameters
Tbeing the type of objects to log
Parameters
prefixbeing the logging prefix
suffixbeing the logging suffix
Returns
a logging function that uses both prefix and suffix

Definition at line 28 of file surrounded.h.