diff --git a/README.md b/README.md index c9893f5..e9d0d3c 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,10 @@ and its default with the `CLUTCHLOG_DEFAULT_DEPTH_MARK` macro: log.depth_mark(CLUTCHLOG_DEFAULT_DEPTH_MARK); // Defaults to ">". ``` +By default, clutchlog removes 5 levels of the calls stack, so that your `main` +entrypoint corresponds to a depth of zero. +You can change this behaviour by defining the `CLUTCHLOG_STRIP_CALLS` macro. + Output style ------------ diff --git a/clutchlog/clutchlog.h b/clutchlog/clutchlog.h index 9a2fd9e..8120717 100644 --- a/clutchlog/clutchlog.h +++ b/clutchlog/clutchlog.h @@ -83,6 +83,10 @@ namespace fs = std::filesystem; #define CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG clutchlog::level::progress #endif // CLUTCHLOG_DEFAULT_DEPTH_BUILT +#ifndef CLUTCHLOG_STRIP_CALLS +//! Number of call stack levels to remove from depth display by default. +#define CLUTCHLOG_STRIP_CALLS 5 +#endif // CLUTCHLOG_STRIP_CALLS /** @} */ /** @addtogroup UseMacros High-level API macros @@ -343,7 +347,7 @@ class clutchlog private: clutchlog() : // system, main, log - _strip_calls(5), + _strip_calls(CLUTCHLOG_STRIP_CALLS), _level_word({ {level::critical,"Critical"}, {level::error ,"Error"}, diff --git a/docs/classclutchlog.html b/docs/classclutchlog.html index 9893573..29852e8 100644 --- a/docs/classclutchlog.html +++ b/docs/classclutchlog.html @@ -385,8 +385,8 @@ template<class ... FMT>
  • clutchlog/clutchlog.h
  • -
    clutchlog::log
    void log(const level &stage, const std::string &what, const std::string &file, const std::string &func, size_t line) const
    Print a log message IF the location matches the given one.
    Definition: clutchlog.h:678
    -
    clutchlog::logger
    static clutchlog & logger()
    Get the logger instance.
    Definition: clutchlog.h:202
    +
    clutchlog::log
    void log(const level &stage, const std::string &what, const std::string &file, const std::string &func, size_t line) const
    Print a log message IF the location matches the given one.
    Definition: clutchlog.h:684
    +
    clutchlog::logger
    static clutchlog & logger()
    Get the logger instance.
    Definition: clutchlog.h:208