2#ifndef LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_SCOPETIMER_HPP_INCLUDED
3#define LOGIT_CPP_HEADER_LOGIT_CPP_LOGIT_DETAIL_SCOPETIMER_HPP_INCLUDED
11namespace logit {
namespace detail {
21 int64_t threshold_ms = 0)
29 ,
t0_(std::chrono::steady_clock::now()) {}
32 const auto t1 = std::chrono::steady_clock::now();
33 const auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(t1 -
t0_).count();
37 msg +=
" | duration_ms=";
38 msg += std::to_string(ms);
60 std::chrono::steady_clock::time_point
t0_;
auto log_and_return(const LogRecord &record, Ts &&... args) -> decltype(std::forward_as_tuple(std::forward< Ts >(args)...))
Logs message and returns tuple of arguments.
static Logger & get_instance()
Retrieves singleton instance of Logger.
ScopeTimer(LogLevel level, std::string phase, const char *file, int line, const char *function, int logger_index, int64_t threshold_ms=0)
std::chrono::steady_clock::time_point t0_
#define LOGIT_WALLCLOCK_MS()
#define LOGIT_BASE_PATH
Defines the base path used for log file paths.
The primary namespace for the LogIt++ library.
std::string make_relative(const std::string &file_path, const std::string &base_path)
Computes the relative path from base_path to file_path.
Stores log metadata and content.