Skip to content

Commit

Permalink
fix: add log level defintion and macro
Browse files Browse the repository at this point in the history
  • Loading branch information
thawk105 committed Mar 11, 2024
1 parent 77e97ec commit 6d52765
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions include/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,35 @@ namespace yakushima {

constexpr static std::string_view log_location_prefix = "/:yakushima ";

/**
* @brief logging level constant for errors
*/
static constexpr std::int32_t log_error = 10;

/**
* @brief logging level constant for warnings
*/
static constexpr std::int32_t log_warning = 20;

/**
* @brief logging level constant for information
*/
static constexpr std::int32_t log_info = 30;

/**
* @brief logging level constant for debug information
*/
static constexpr std::int32_t log_debug = 40;

/**
* @brief logging level constant for traces
*/
static constexpr std::int32_t log_trace = 50;

#define yakushima_log_entry \
VLOG(log_trace) << std::boolalpha << log_location_prefix << "-->"; // NOLINT
VLOG(log_trace) << std::boolalpha << log_location_prefix << "-->" // NOLINT

#define yakushima_log_exit \
VLOG(log_trace) << std::boolalpha << log_location_prefix << "<--"; // NOLINT
VLOG(log_trace) << std::boolalpha << log_location_prefix << "<--" // NOLINT

} // namespace yakushima

0 comments on commit 6d52765

Please sign in to comment.