5 # ifndef VCCC_LOG_LOG_HPP
6 # define VCCC_LOG_LOG_HPP
69 template<
typename ...Args>
void d(
const Args&... args)
const {
74 template<
typename ...Args>
void i(
const Args&... args)
const {
79 template<
typename ...Args>
void w(
const Args&... args)
const {
84 template<
typename ...Args>
void e(
const Args&... args)
const {
88 template<
typename... Args>
117 int dummy[] = { (stream << args, 0)... };
130 template<
typename ...Args>
void d_(
const char* tag,
const std::string& str)
const {
LOGD_IMPL(tag,
"%s", str.c_str()); }
131 template<
typename ...Args>
void i_(
const char* tag,
const std::string& str)
const {
LOGI_IMPL(tag,
"%s", str.c_str()); }
132 template<
typename ...Args>
void w_(
const char* tag,
const std::string& str)
const {
LOGW_IMPL(tag,
"%s", str.c_str()); }
133 template<
typename ...Args>
void e_(
const char* tag,
const std::string& str)
const {
LOGE_IMPL(tag,
"%s", str.c_str()); }
161 # define LOGD(...) ::vccc::Log.d(__VA_ARGS__)
162 # define LOGID(...) ::vccc::Log.i(__VA_ARGS__)
163 # define LOGWD(...) ::vccc::Log.w(__VA_ARGS__)
164 # define LOGED(...) ::vccc::Log.e(__VA_ARGS__)
168 # define LOGI(...) ::vccc::Log.i(__VA_ARGS__)
170 # define LOGW(...) ::vccc::Log.w(__VA_ARGS__)
172 # define LOGE(...) ::vccc::Log.e(__VA_ARGS__)
stream wrapper that supports extended operator overloading
Definition: stream_wrapper.hpp:186
stream_type & stream()
Return internal stream.
Definition: stream_wrapper.hpp:237
string_type str() const
Equals to stream().str()
Definition: stream_wrapper.hpp:244
Ease use of vccc::StreamWrapper.
Definition: logger.hpp:54
void w(const Args &... args) const
Warning log.
Definition: logger.hpp:79
constexpr Logger()=default
static string_type & global_separator()
Equals to stream_type::global_separator.
Definition: logger.hpp:125
Priority
Definition: logger.hpp:56
@ kDebug
Definition: logger.hpp:57
@ kError
Definition: logger.hpp:60
@ kWarn
Definition: logger.hpp:59
@ kInfo
Definition: logger.hpp:58
void i(const Args &... args) const
Informational log.
Definition: logger.hpp:74
void operator()(Priority priority, const char *tag, const Args &... args) const
Definition: logger.hpp:89
void e(const Args &... args) const
Error log.
Definition: logger.hpp:84
void d(const Args &... args) const
Log output as debug.
Definition: logger.hpp:69
string_type to_string(const Args &... args) const
Return logged value as std::string.
Definition: logger.hpp:115
std::string string_type
Definition: logger.hpp:64
static string_type & global_separator()
Get global separator.
Definition: stream_wrapper.hpp:108
BasicStreamWrapper< char > StreamWrapper
Definition: stream_wrapper.hpp:657
constexpr VCCC_INLINE_OR_STATIC Logger Log
Global vccc::Logger instance for syntax sugar.
Definition: logger.hpp:139
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
#define LOGD_IMPL(tag, fmt,...)
Definition: log_impl.h:13
#define LOGW_IMPL(tag, fmt,...)
Definition: log_impl.h:17
#define LOGI_IMPL(tag, fmt,...)
Definition: log_impl.h:16
#define LOGE_IMPL(tag, fmt,...)
Definition: log_impl.h:18
Definition: directory.h:12
#define VCCC_LOG_TAG_INFO
Definition: tag.h:9
#define VCCC_LOG_TAG_DEBUG
Definition: tag.h:8
#define VCCC_LOG_TAG_ERROR
Definition: tag.h:11
#define VCCC_LOG_TAG_WARN
Definition: tag.h:10