diff --git a/CMakeLists.txt b/CMakeLists.txt index b1e87cb..0d4539d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,19 +6,19 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) project("clutchlog" - VERSION 0.10 + VERSION 0.11 DESCRIPTION "A logging system which targets versatile debugging") enable_language(CXX) # C++ set(CMAKE_CXX_STANDARD 17) -if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -std=c++17 -lstdc++fs") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) link_libraries(stdc++fs) add_compile_definitions(FSEXPERIMENTAL) endif() -endif() +endif() ###################################################################################### diff --git a/README.md b/README.md index 88733e9..578f04b 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,8 @@ Available tags are: - `{level_letter}`: the first letter of the current log level, - `{file}`: the current file (absolute path), - `{func}`: the current function, -- `{line}`: the current line number. +- `{line}`: the current line number, +- `{level_fmt}`: the format of the current level (i.e. configured with `clutchlog::style`). Some tags are only available on POSIX operating systems as of now: - `{name}`: the name of the current binary, diff --git a/docs/annotated.html b/docs/annotated.html index d1602d8..7884bea 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -22,7 +22,7 @@
| ▼Cclutchlog | |
| ▼Cclutchlog | The single class which holds everything |
| Cfmt | Color and style formatter for ANSI terminal escape sequences |
| Cscope_t | Structure holding a location matching |
This is the complete list of members for clutchlog, including all inherited members.
| _format_dump | clutchlog | protected |
| _format_log | clutchlog | protected |
| _in_file | clutchlog | protected |
| _in_func | clutchlog | protected |
| _in_line | clutchlog | protected |
| _level_fmt | clutchlog | protected |
| _level_word | clutchlog | protected |
| _out | clutchlog | protected |
| _stage | clutchlog | protected |
| _strip_calls | clutchlog | protected |
| _word_level | clutchlog | protected |
| _format_dump | clutchlog | protected |
| _format_log | clutchlog | protected |
| _in_file | clutchlog | protected |
| _in_func | clutchlog | protected |
| _in_line | clutchlog | protected |
| _level_fmt | clutchlog | protected |
| _level_word | clutchlog | protected |
| _out | clutchlog | protected |
| _stage | clutchlog | protected |
| _strip_calls | clutchlog | protected |
| _word_level | clutchlog | protected |
| clutchlog(clutchlog const &)=delete (defined in clutchlog) | clutchlog | |
| critical enum value (defined in clutchlog) | clutchlog | |
| debug enum value (defined in clutchlog) | clutchlog | |
| default_depth_mark | clutchlog | inlineprotectedstatic |
| default_format | clutchlog | inlineprotectedstatic |
| default_hfill_char | clutchlog | inlineprotectedstatic |
| default_hfill_max | clutchlog | inlineprotectedstatic |
| default_strip_calls | clutchlog | inlineprotectedstatic |
| dump(const level &stage, const In container_begin, const In container_end, const std::string &file, const std::string &func, size_t line, const std::string &filename_template="dump_{n}.dat", const std::string sep=dump_default_sep) const | clutchlog | inline |
| dump_default_format | clutchlog | inlineprotectedstatic |
| dump_default_sep | clutchlog | inlineprotectedstatic |
| default_depth_mark | clutchlog | inlineprotectedstatic |
| default_format | clutchlog | inlineprotectedstatic |
| default_hfill_char | clutchlog | inlineprotectedstatic |
| default_hfill_max | clutchlog | inlineprotectedstatic |
| default_strip_calls | clutchlog | inlineprotectedstatic |
| dump(const level &stage, const In container_begin, const In container_end, const std::string &file, const std::string &func, size_t line, const std::string &filename_template="dump_{n}.dat", const std::string sep=dump_default_sep) const | clutchlog | inline |
| dump_default_format | clutchlog | inlineprotectedstatic |
| dump_default_sep | clutchlog | inlineprotectedstatic |
| error enum value (defined in clutchlog) | clutchlog | |
| file(std::string file) | clutchlog | inline |
| format(const std::string &format) | clutchlog | inline |
| format() const | clutchlog | inline |
| format(std::string format, const std::string &what, const level &stage, const std::string &file, const std::string &func, const size_t line) const | clutchlog | inline |
| format_comment(const std::string &format) | clutchlog | inline |
| format_comment() const | clutchlog | inline |
| func(std::string func) | clutchlog | inline |
| file(std::string file) | clutchlog | inline |
| format(const std::string &format) | clutchlog | inline |
| format() const | clutchlog | inline |
| format(std::string row, const std::string &what, const level &stage, const std::string &file, const std::string &func, const size_t line) const | clutchlog | inline |
| format_comment(const std::string &format) | clutchlog | inline |
| format_comment() const | clutchlog | inline |
| func(std::string func) | clutchlog | inline |
| info enum value (defined in clutchlog) | clutchlog | |
| level enum name | clutchlog | |
| level_of(const std::string name) | clutchlog | inline |
| levels() const | clutchlog | inline |
| line(std::string line) | clutchlog | inline |
| locate(const level &stage, const std::string &file, const std::string &func, const size_t line) const | clutchlog | inline |
| location(const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*") | clutchlog | inline |
| log(const level &stage, const std::string &what, const std::string &file, const std::string &func, size_t line) const | clutchlog | inline |
| logger() | clutchlog | inlinestatic |
| level enum name | clutchlog | |
| level_of(const std::string name) | clutchlog | inline |
| levels() const | clutchlog | inline |
| line(std::string line) | clutchlog | inline |
| locate(const level &stage, const std::string &file, const std::string &func, const size_t line) const | clutchlog | inline |
| location(const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*") | clutchlog | inline |
| log(const level &stage, const std::string &what, const std::string &file, const std::string &func, size_t line) const | clutchlog | inline |
| logger() | clutchlog | inlinestatic |
| note enum value (defined in clutchlog) | clutchlog | |
| operator=(clutchlog const &)=delete (defined in clutchlog) | clutchlog | |
| out(std::ostream &out) | clutchlog | inline |
| out() | clutchlog | inline |
| out(std::ostream &out) | clutchlog | inline |
| out() | clutchlog | inline |
| progress enum value (defined in clutchlog) | clutchlog | |
| replace(const std::string &form, const std::string &mark, const std::string &tag) const | clutchlog | inline |
| replace(const std::string &form, const std::string &mark, const size_t tag) const | clutchlog | inline |
| style(level stage, FMT... styles) | clutchlog | inline |
| style(level stage, fmt style) | clutchlog | inline |
| style(level stage) const | clutchlog | inline |
| threshold(level l) | clutchlog | inline |
| threshold(const std::string &l) | clutchlog | inline |
| threshold() const | clutchlog | inline |
| replace(const std::string &form, const std::string &mark, const std::string &tag) const | clutchlog | inline |
| replace(const std::string &form, const std::string &mark, const size_t tag) const | clutchlog | inline |
| style(level stage, FMT... styles) | clutchlog | inline |
| style(level stage, fmt style) | clutchlog | inline |
| style(level stage) const | clutchlog | inline |
| threshold(level l) | clutchlog | inline |
| threshold(const std::string &l) | clutchlog | inline |
| threshold() const | clutchlog | inline |
| warning enum value (defined in clutchlog) | clutchlog | |
| xdebug enum value (defined in clutchlog) | clutchlog |
The single class which holds everything. + More...
+ +#include <clutchlog.h>
Classes | |
Public Member Functions | |
Configuration accessors | |
| -void | format (const std::string &format) |
| Set the template string. | |
| -std::string | format () const |
| Get the template string. | |
| -void | format_comment (const std::string &format) |
| Set the template string for dumps. | |
| -std::string | format_comment () const |
| Get the template string for dumps. | |
| -void | out (std::ostream &out) |
| Set the output stream on which to print. | |
| -std::ostream & | out () |
| Get the output stream on which to print. | |
| -void | threshold (level l) |
| Set the log level (below which logs are not printed) with an identifier. | |
| -void | threshold (const std::string &l) |
| Set the log level (below which logs are not printed) with a string. | |
| -level | threshold () const |
| Get the log level below which logs are not printed. | |
| -const std::map< std::string, level > & | levels () const |
| Get the map of available log levels string representations toward their identifier. */. | |
| level | level_of (const std::string name) |
| Return the log level tag corresponding to the given pre-configured name. More... | |
| -void | file (std::string file) |
| Set the regular expression filtering the file location. | |
| -void | func (std::string func) |
| Set the regular expression filtering the function location. | |
| -void | line (std::string line) |
| Set the regular expression filtering the line location. | |
| -void | location (const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*") |
| Set the regular expressions filtering the location. | |
| template<class ... FMT> | |
| void | style (level stage, FMT... styles) |
| Set the style (color and typo) of the given log level. More... | |
| -void | style (level stage, fmt style) |
Set the style (color and typo) of the given log level, passing a fmt instance. | |
| -fmt | style (level stage) const |
| Get the configured fmt instance of the given log level. | |
| +void | format (const std::string &format) |
| Set the template string. | |
| +std::string | format () const |
| Get the template string. | |
| +void | format_comment (const std::string &format) |
| Set the template string for dumps. | |
| +std::string | format_comment () const |
| Get the template string for dumps. | |
| +void | out (std::ostream &out) |
| Set the output stream on which to print. | |
| +std::ostream & | out () |
| Get the output stream on which to print. | |
| +void | threshold (level l) |
| Set the log level (below which logs are not printed) with an identifier. | |
| +void | threshold (const std::string &l) |
| Set the log level (below which logs are not printed) with a string. | |
| +level | threshold () const |
| Get the log level below which logs are not printed. | |
| +const std::map< std::string, level > & | levels () const |
| Get the map of available log levels string representations toward their identifier. */. | |
| level | level_of (const std::string name) |
| Return the log level tag corresponding to the given pre-configured name. More... | |
| +void | file (std::string file) |
| Set the regular expression filtering the file location. | |
| +void | func (std::string func) |
| Set the regular expression filtering the function location. | |
| +void | line (std::string line) |
| Set the regular expression filtering the line location. | |
| +void | location (const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*") |
| Set the regular expressions filtering the location. | |
| template<class ... FMT> | |
| void | style (level stage, FMT... styles) |
| Set the style (color and typo) of the given log level. More... | |
| +void | style (level stage, fmt style) |
Set the style (color and typo) of the given log level, passing a fmt instance. | |
| +fmt | style (level stage) const |
| Get the configured fmt instance of the given log level. | |
Low-level API | |
| -scope_t | locate (const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Gather information on the current location of the call. | |
| std::string | replace (const std::string &form, const std::string &mark, const std::string &tag) const |
Replace mark by tag in form. More... | |
| -std::string | replace (const std::string &form, const std::string &mark, const size_t tag) const |
Replace mark by tag in form, converting tag to its string representation first. | |
| -std::string | format (std::string format, const std::string &what, const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Substitute all tags in the format string with the corresponding information and apply the style corresponding to the log level. | |
| -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. | |
| + | |
| +scope_t | locate (const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Gather information on the current location of the call. | |
| std::string | replace (const std::string &form, const std::string &mark, const std::string &tag) const |
Replace mark by tag in form. More... | |
| +std::string | replace (const std::string &form, const std::string &mark, const size_t tag) const |
Replace mark by tag in form, converting tag to its string representation first. | |
| +std::string | format (std::string row, const std::string &what, const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Substitute all tags in the format string with the corresponding information and apply the style corresponding to the log level. | |
| +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. | |
| template<class In > | |
| void | dump (const level &stage, const In container_begin, const In container_end, const std::string &file, const std::string &func, size_t line, const std::string &filename_template="dump_{n}.dat", const std::string sep=dump_default_sep) const |
| Dump a serializable container after a comment line with log information. | |
| void | dump (const level &stage, const In container_begin, const In container_end, const std::string &file, const std::string &func, size_t line, const std::string &filename_template="dump_{n}.dat", const std::string sep=dump_default_sep) const |
| Dump a serializable container after a comment line with log information. | |
Static Protected Attributes | |
| -static std::string | default_format = CLUTCHLOG_DEFAULT_FORMAT |
| Default format of the messages. | |
| -static std::string | dump_default_format = CLUTCHDUMP_DEFAULT_FORMAT |
| Default format of the comment line in file dump. | |
| -static std::string | dump_default_sep = CLUTCHDUMP_DEFAULT_SEP |
| Default item separator for dump. | |
| -static std::string | default_depth_mark = CLUTCHLOG_DEFAULT_DEPTH_MARK |
| Default mark for stack depth. | |
| -static unsigned int | default_strip_calls = CLUTCHLOG_STRIP_CALLS |
| Number of call stack levels to remove from depth display by default. | |
| -static char | default_hfill_char = CLUTCHLOG_HFILL_MARK |
| Default character used as a filling for right-align the right part of messages with "{hfill}". | |
| -static unsigned short | default_hfill_max = CLUTCHLOG_HFILL_MAX |
| Default maximum number of character used as a filling for right-align the right part of messages with "{hfill}". | |
Default configuration members | |
| +static std::string | default_format = CLUTCHLOG_DEFAULT_FORMAT |
| Default format of the messages. | |
| +static std::string | dump_default_format = CLUTCHDUMP_DEFAULT_FORMAT |
| Default format of the comment line in file dump. | |
| +static std::string | dump_default_sep = CLUTCHDUMP_DEFAULT_SEP |
| Default item separator for dump. | |
| +static std::string | default_depth_mark = CLUTCHLOG_DEFAULT_DEPTH_MARK |
| Default mark for stack depth. | |
| +static unsigned int | default_strip_calls = CLUTCHLOG_STRIP_CALLS |
| Number of call stack levels to remove from depth display by default. | |
| +static char | default_hfill_char = CLUTCHLOG_HFILL_MARK |
| Default character used as a filling for right-align the right part of messages with "{hfill}". | |
| +static size_t | default_hfill_max = CLUTCHLOG_HFILL_MAX |
| Default maximum number of character used as a filling for right-align the right part of messages with "{hfill}". | |
High-level API | |
| enum | level { + |
| enum | level { critical =0, error =1, warning =2, @@ -225,69 +230,219 @@ High-level API |
| Available log levels. | |
| static clutchlog & | logger () |
| Get the logger instance. More... | |
| Available log levels. | |
| static clutchlog & | logger () |
| Get the logger instance. More... | |
Internal details | |
| -size_t | _strip_calls |
| Current number of call stack levels to remove from depth display. | |
| -const std::map< level, std::string > | _level_word |
| Dictionary of level identifier to their string representation. | |
| -std::map< std::string, level > | _word_level |
| Dictionary of level string to their identifier. | |
| -std::map< level, fmt > | _level_fmt |
| Dictionary of level identifier to their format. | |
| -std::string | _format_log |
| Current format of the standard output. | |
| -std::string | _format_dump |
| Current format of the file output. | |
| -std::ostream * | _out |
| Standard output. | |
| -level | _stage |
| Current log level. | |
| -std::regex | _in_file |
| Current file location filter. | |
| -std::regex | _in_func |
| Current function location filter. | |
| -std::regex | _in_line |
| Current line location filter. | |
| + | |
| +size_t | _strip_calls |
| Current number of call stack levels to remove from depth display. | |
| +const std::map< level, std::string > | _level_word |
| Dictionary of level identifier to their string representation. | |
| +std::map< std::string, level > | _word_level |
| Dictionary of level string to their identifier. | |
| +std::map< level, fmt > | _level_fmt |
| Dictionary of level identifier to their format. | |
| +std::string | _format_log |
| Current format of the standard output. | |
| +std::string | _format_dump |
| Current format of the file output. | |
| +std::ostream * | _out |
| Standard output. | |
| +level | _stage |
| Current log level. | |
| +std::regex | _in_file |
| Current file location filter. | |
| +std::regex | _in_func |
| Current function location filter. | |
| +std::regex | _in_line |
| Current line location filter. | |
| clutchlog (clutchlog const &)=delete | |
| + | |
| void | operator= (clutchlog const &)=delete |
The single class which holds everything.
+This is a Singleton class.
+
+
|
+ +inline | +
Return the log level tag corresponding to the given pre-configured name.
+_level_word.
+
|
+ +inlinestatic | +
Get the logger instance.
+
+
|
+ +inline | +
Replace mark by tag in form.
+
|
+ +inline | +
Set the style (color and typo) of the given log level.
+This version accept style arguments as if they were passed to clutchlog::fmt.
This is the complete list of members for clutchlog::fmt, including all inherited members.
| back | clutchlog::fmt | |
| bg enum name | clutchlog::fmt | |
| fg enum name | clutchlog::fmt | |
| fmt() | clutchlog::fmt | inline |
| back | clutchlog::fmt | |
| bg enum name | clutchlog::fmt | |
| fg enum name | clutchlog::fmt | |
| fmt() | clutchlog::fmt | inline |
| fmt(fg f, bg b=bg::none, typo s=typo::none) (defined in clutchlog::fmt) | clutchlog::fmt | inline |
| fmt(fg f, typo s, bg b=bg::none) (defined in clutchlog::fmt) | clutchlog::fmt | inline |
| fmt(bg b, fg f=fg::none, typo s=typo::none) (defined in clutchlog::fmt) | clutchlog::fmt | inline |
| fmt(bg b, typo s, fg f=fg::none) (defined in clutchlog::fmt) | clutchlog::fmt | inline |
| fmt(typo s, fg f=fg::none, bg b=bg::none) (defined in clutchlog::fmt) | clutchlog::fmt | inline |
| fmt(typo s, bg b, fg f=fg::none) (defined in clutchlog::fmt) | clutchlog::fmt | inline |
| fore | clutchlog::fmt | |
| operator()(const std::string &msg) const | clutchlog::fmt | inline |
| operator<<(std::ostream &os, const fmt &fmt) | clutchlog::fmt | friend |
| print_on(std::ostream &os) const | clutchlog::fmt | inlineprotected |
| style | clutchlog::fmt | |
| typo enum name | clutchlog::fmt | |
| fore | clutchlog::fmt | |
| operator()(const std::string &msg) const | clutchlog::fmt | inline |
| operator<<(std::ostream &os, const fmt &fmt) | clutchlog::fmt | friend |
| print_on(std::ostream &os) const | clutchlog::fmt | inlineprotected |
| str() const | clutchlog::fmt | inline |
| style | clutchlog::fmt | |
| typo enum name | clutchlog::fmt |
Public Types | |
| enum | fg { + |
| enum | fg { black = 30, red = 31, green = 32, @@ -99,9 +99,9 @@ Public Types |
| Foreground color codes. | |
| enum | bg { + |
| Foreground color codes. | |
| enum | bg { black = 40, red = 41, green = 42, @@ -115,9 +115,9 @@ Public Types |
| Background color codes. | |
| enum | typo { + |
| Background color codes. | |
| enum | typo { reset = 0, bold = 1, underline = 4, @@ -126,73 +126,153 @@ Public Types |
| Typographic style codes. | |
| Typographic style codes. | |
Public Member Functions | |
| - | fmt () |
| Empty constructor, only useful for a no-op formatter. | |
| std::string | operator() (const std::string &msg) const |
| Format the given string with the currently encoded format. More... | |
| + | fmt () |
| Empty constructor, only useful for a no-op formatter. | |
| std::string | operator() (const std::string &msg) const |
| Format the given string with the currently encoded format. More... | |
| +std::string | str () const |
| Return the formatting code as a string. | |
All combination of constructors with different parameters orders. | |
| - | fmt (fg f, bg b=bg::none, typo s=typo::none) |
| - | fmt (fg f, typo s, bg b=bg::none) |
| - | fmt (bg b, fg f=fg::none, typo s=typo::none) |
| - | fmt (bg b, typo s, fg f=fg::none) |
| - | fmt (typo s, fg f=fg::none, bg b=bg::none) |
| - | fmt (typo s, bg b, fg f=fg::none) |
| + | fmt (fg f, bg b=bg::none, typo s=typo::none) |
| + | fmt (fg f, typo s, bg b=bg::none) |
| + | fmt (bg b, fg f=fg::none, typo s=typo::none) |
| + | fmt (bg b, typo s, fg f=fg::none) |
| + | fmt (typo s, fg f=fg::none, bg b=bg::none) |
| + | fmt (typo s, bg b, fg f=fg::none) |
Public Attributes | |
| -enum clutchlog::fmt::fg | fore |
| Foreground color. | |
| -enum clutchlog::fmt::bg | back |
| Background color. | |
| -enum clutchlog::fmt::typo | style |
| Typographic style. | |
| +enum clutchlog::fmt::fg | fore |
| Foreground color. | |
| +enum clutchlog::fmt::bg | back |
| Background color. | |
| +enum clutchlog::fmt::typo | style |
| Typographic style. | |
Protected Member Functions | |
| -std::ostream & | print_on (std::ostream &os) const |
| Print the currently encoded format escape code on the given output stream. | |
| +std::ostream & | print_on (std::ostream &os) const |
| Print the currently encoded format escape code on the given output stream. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const fmt &fmt) |
| Output stream overload. More... | |
| std::ostream & | operator<< (std::ostream &os, const fmt &fmt) |
| Output stream overload. More... | |
Color and style formatter for ANSI terminal escape sequences.
+
|
+ +inline | +
Format the given string with the currently encoded format.
+Allow to use a formatter as a function:
+
|
+ +friend | +
Output stream overload.
+Allow to use a formatter as a tag within a stream:
hfill feature. 
+Modules | |
| Formating tools | |
+Classes | |
| struct | clutchlog::scope_t |
| Structure holding a location matching. More... | |
Macros | |
| #define | CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG clutchlog::level::progress |
| Default level over which calls to the logger are optimized out when NDEBUG is defined. | |
| +#define | CLUTCHLOG_DEFAULT_FORMAT "{level_letter} {msg}\t\t\t\t\t{func} @ {file}:{line}\n" |
| Compile-time default format of the messages (debug mode: with absolute location). | |
| +#define | CLUTCHDUMP_DEFAULT_FORMAT "# {level} in {func} @ {file}:{line}" |
| Compile-time default format of the comment line in file dump. | |
| +#define | CLUTCHDUMP_DEFAULT_SEP "\n" |
| Compile-time default item separator for dump. | |
| +#define | CLUTCHLOG_DEFAULT_DEPTH_MARK ">" |
| Compile-time default mark for stack depth. | |
| +#define | CLUTCHLOG_STRIP_CALLS 5 |
| Compile-time number of call stack levels to remove from depth display by default. | |
| +#define | CLUTCHLOG_HFILL_MARK '.' |
| Character used as a filling for right-align the right part of messages with "{hfill}". | |
+Enumerations | |
| enum | clutchlog::fmt::fg { + black = 30, +red = 31, +green = 32, +yellow = 33, + + blue = 34, +magenta = 35, +cyan = 36, +white = 37, + + none + + } |
| Foreground color codes. | |
| enum | clutchlog::fmt::bg { + black = 40, +red = 41, +green = 42, +yellow = 43, + + blue = 44, +magenta = 45, +cyan = 46, +white = 47, + + none + + } |
| Background color codes. | |
| enum | clutchlog::fmt::typo { + reset = 0, +bold = 1, +underline = 4, +inverse = 7, + + none + + } |
| Typographic style codes. | |
+Functions | |
| + | clutchlog::fmt::fmt () |
| Empty constructor, only useful for a no-op formatter. | |
| +std::ostream & | clutchlog::fmt::print_on (std::ostream &os) const |
| Print the currently encoded format escape code on the given output stream. | |
| std::string | clutchlog::fmt::operator() (const std::string &msg) const |
| Format the given string with the currently encoded format. More... | |
| +std::string | clutchlog::fmt::str () const |
| Return the formatting code as a string. | |
| + | clutchlog::scope_t::scope_t () |
| Constructor. | |
+Variables | |
| +static std::string | clutchlog::default_format = CLUTCHLOG_DEFAULT_FORMAT |
| Default format of the messages. | |
| +static std::string | clutchlog::dump_default_format = CLUTCHDUMP_DEFAULT_FORMAT |
| Default format of the comment line in file dump. | |
| +static std::string | clutchlog::dump_default_sep = CLUTCHDUMP_DEFAULT_SEP |
| Default item separator for dump. | |
| +static std::string | clutchlog::default_depth_mark = CLUTCHLOG_DEFAULT_DEPTH_MARK |
| Default mark for stack depth. | |
| +static unsigned int | clutchlog::default_strip_calls = CLUTCHLOG_STRIP_CALLS |
| Number of call stack levels to remove from depth display by default. | |
| +static char | clutchlog::default_hfill_char = CLUTCHLOG_HFILL_MARK |
| Default character used as a filling for right-align the right part of messages with "{hfill}". | |
| +static unsigned short | clutchlog::default_hfill_max = CLUTCHLOG_HFILL_MAX |
| Default maximum number of character used as a filling for right-align the right part of messages with "{hfill}". | |
| +enum clutchlog::fmt::fg | clutchlog::fmt::fore |
| Foreground color. | |
| +enum clutchlog::fmt::bg | clutchlog::fmt::back |
| Background color. | |
| +enum clutchlog::fmt::typo | clutchlog::fmt::style |
| Typographic style. | |
| +bool | clutchlog::scope_t::matches |
| Everything is compatible. | |
| +level | clutchlog::scope_t::stage |
| Current log level. | |
| +bool | clutchlog::scope_t::there |
| Location is compatible. | |
+Friends | |
| std::ostream & | clutchlog::fmt::operator<< (std::ostream &os, const fmt &fmt) |
| Output stream overload. More... | |
+High-level API | |
| enum | clutchlog::level { + critical =0, +error =1, +warning =2, +progress =3, + + note =4, +info =5, +debug =6, +xdebug =7 + + } |
| Available log levels. | |
| static clutchlog & | clutchlog::logger () |
| Get the logger instance. More... | |
+Internal details | |
| +size_t | clutchlog::_strip_calls |
| Current number of call stack levels to remove from depth display. | |
| +const std::map< level, std::string > | clutchlog::_level_word |
| Dictionary of level identifier to their string representation. | |
| +std::map< std::string, level > | clutchlog::_word_level |
| Dictionary of level string to their identifier. | |
| +std::map< level, fmt > | clutchlog::_level_fmt |
| Dictionary of level identifier to their format. | |
| +std::string | clutchlog::_format_log |
| Current format of the standard output. | |
| +std::string | clutchlog::_format_dump |
| Current format of the file output. | |
| +std::ostream * | clutchlog::_out |
| Standard output. | |
| +level | clutchlog::_stage |
| Current log level. | |
| +std::regex | clutchlog::_in_file |
| Current file location filter. | |
| +std::regex | clutchlog::_in_func |
| Current function location filter. | |
| +std::regex | clutchlog::_in_line |
| Current line location filter. | |
| + | clutchlog::clutchlog (clutchlog const &)=delete |
| +void | clutchlog::operator= (clutchlog const &)=delete |
+Configuration accessors | |
| +void | clutchlog::format (const std::string &format) |
| Set the template string. | |
| +std::string | clutchlog::format () const |
| Get the template string. | |
| +void | clutchlog::format_comment (const std::string &format) |
| Set the template string for dumps. | |
| +std::string | clutchlog::format_comment () const |
| Get the template string for dumps. | |
| +void | clutchlog::out (std::ostream &out) |
| Set the output stream on which to print. | |
| +std::ostream & | clutchlog::out () |
| Get the output stream on which to print. | |
| +void | clutchlog::threshold (level l) |
| Set the log level (below which logs are not printed) with an identifier. | |
| +void | clutchlog::threshold (const std::string &l) |
| Set the log level (below which logs are not printed) with a string. | |
| +level | clutchlog::threshold () const |
| Get the log level below which logs are not printed. | |
| +const std::map< std::string, level > & | clutchlog::levels () const |
| Get the map of available log levels string representations toward their identifier. */. | |
| level | clutchlog::level_of (const std::string name) |
| Return the log level tag corresponding to the given pre-configured name. More... | |
| +void | clutchlog::file (std::string file) |
| Set the regular expression filtering the file location. | |
| +void | clutchlog::func (std::string func) |
| Set the regular expression filtering the function location. | |
| +void | clutchlog::line (std::string line) |
| Set the regular expression filtering the line location. | |
| +void | clutchlog::location (const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*") |
| Set the regular expressions filtering the location. | |
| template<class ... FMT> | |
| void | clutchlog::style (level stage, FMT... styles) |
| Set the style (color and typo) of the given log level. More... | |
| +void | clutchlog::style (level stage, fmt style) |
Set the style (color and typo) of the given log level, passing a fmt instance. | |
| +fmt | clutchlog::style (level stage) const |
| Get the configured fmt instance of the given log level. | |
+Low-level API | |
| +scope_t | clutchlog::locate (const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Gather information on the current location of the call. | |
| std::string | clutchlog::replace (const std::string &form, const std::string &mark, const std::string &tag) const |
Replace mark by tag in form. More... | |
| +std::string | clutchlog::replace (const std::string &form, const std::string &mark, const size_t tag) const |
Replace mark by tag in form, converting tag to its string representation first. | |
| +std::string | clutchlog::format (std::string format, const std::string &what, const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Substitute all tags in the format string with the corresponding information and apply the style corresponding to the log level. | |
| +void | clutchlog::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. | |
| +template<class In > | |
| void | clutchlog::dump (const level &stage, const In container_begin, const In container_end, const std::string &file, const std::string &func, size_t line, const std::string &filename_template="dump_{n}.dat", const std::string sep=dump_default_sep) const |
| Dump a serializable container after a comment line with log information. | |
+All combination of constructors with different parameters orders. | |
| + | clutchlog::fmt::fmt (fg f, bg b=bg::none, typo s=typo::none) |
| + | clutchlog::fmt::fmt (fg f, typo s, bg b=bg::none) |
| + | clutchlog::fmt::fmt (bg b, fg f=fg::none, typo s=typo::none) |
| + | clutchlog::fmt::fmt (bg b, typo s, fg f=fg::none) |
| + | clutchlog::fmt::fmt (typo s, fg f=fg::none, bg b=bg::none) |
| + | clutchlog::fmt::fmt (typo s, bg b, fg f=fg::none) |
+
|
+ +inline | +
Return the log level tag corresponding to the given pre-configured name.
+_level_word.
+
|
+ +inlinestatic | +
Get the logger instance.
+
+
|
+ +inline | +
Format the given string with the currently encoded format.
+Allow to use a formatter as a function:
+
|
+ +inline | +
Replace mark by tag in form.
+
|
+ +inline | +
Set the style (color and typo) of the given log level.
+This version accept style arguments as if they were passed to clutchlog::fmt.
+
|
+ +friend | +
Output stream overload.
+Allow to use a formatter as a tag within a stream:

Classes | |
|
clutchlog
- 0.10
+ 0.11
|
|
Classes | |
| class | clutchlog |
| The single class which holds everything. More... | |
The single class which holds everything.
-This is a Singleton class.

-Modules | |
| Formating tools | |
-Classes | |
| struct | clutchlog::scope_t |
| Structure holding a location matching. More... | |
Macros | |
| @@ -114,350 +87,6 @@ Macros | |
| #define | CLUTCHCODE(LEVEL, ...) |
| Run any code if the scope matches. More... | |
| -#define | CLUTCHLOG_DEFAULT_FORMAT "{level_letter} {msg}\t\t\t\t\t{func} @ {file}:{line}\n" |
| Compile-time default format of the messages (debug mode: with absolute location). | |
| -#define | CLUTCHDUMP_DEFAULT_FORMAT "# {level} in {func} @ {file}:{line}" |
| Compile-time default format of the comment line in file dump. | |
| -#define | CLUTCHDUMP_DEFAULT_SEP "\n" |
| Compile-time default item separator for dump. | |
| -#define | CLUTCHLOG_DEFAULT_DEPTH_MARK ">" |
| Compile-time default mark for stack depth. | |
| -#define | CLUTCHLOG_STRIP_CALLS 5 |
| Compile-time number of call stack levels to remove from depth display by default. | |
| -#define | CLUTCHLOG_HFILL_MARK '.' |
| Character used as a filling for right-align the right part of messages with "{hfill}". | |
-Enumerations | |
| enum | clutchlog::fmt::fg { - black = 30, -red = 31, -green = 32, -yellow = 33, - - blue = 34, -magenta = 35, -cyan = 36, -white = 37, - - none - - } |
| Foreground color codes. | |
| enum | clutchlog::fmt::bg { - black = 40, -red = 41, -green = 42, -yellow = 43, - - blue = 44, -magenta = 45, -cyan = 46, -white = 47, - - none - - } |
| Background color codes. | |
| enum | clutchlog::fmt::typo { - reset = 0, -bold = 1, -underline = 4, -inverse = 7, - - none - - } |
| Typographic style codes. | |
-Functions | |
| - | clutchlog::fmt::fmt () |
| Empty constructor, only useful for a no-op formatter. | |
| -std::ostream & | clutchlog::fmt::print_on (std::ostream &os) const |
| Print the currently encoded format escape code on the given output stream. | |
| std::string | clutchlog::fmt::operator() (const std::string &msg) const |
| Format the given string with the currently encoded format. More... | |
| - | clutchlog::scope_t::scope_t () |
| Constructor. | |
-Variables | |
| -static std::string | clutchlog::default_format = CLUTCHLOG_DEFAULT_FORMAT |
| Default format of the messages. | |
| -static std::string | clutchlog::dump_default_format = CLUTCHDUMP_DEFAULT_FORMAT |
| Default format of the comment line in file dump. | |
| -static std::string | clutchlog::dump_default_sep = CLUTCHDUMP_DEFAULT_SEP |
| Default item separator for dump. | |
| -static std::string | clutchlog::default_depth_mark = CLUTCHLOG_DEFAULT_DEPTH_MARK |
| Default mark for stack depth. | |
| -static unsigned int | clutchlog::default_strip_calls = CLUTCHLOG_STRIP_CALLS |
| Number of call stack levels to remove from depth display by default. | |
| -static char | clutchlog::default_hfill_char = CLUTCHLOG_HFILL_MARK |
| Default character used as a filling for right-align the right part of messages with "{hfill}". | |
| -static unsigned short | clutchlog::default_hfill_max = CLUTCHLOG_HFILL_MAX |
| Default maximum number of character used as a filling for right-align the right part of messages with "{hfill}". | |
| -enum clutchlog::fmt::fg | clutchlog::fmt::fore |
| Foreground color. | |
| -enum clutchlog::fmt::bg | clutchlog::fmt::back |
| Background color. | |
| -enum clutchlog::fmt::typo | clutchlog::fmt::style |
| Typographic style. | |
| -bool | clutchlog::scope_t::matches |
| Everything is compatible. | |
| -level | clutchlog::scope_t::stage |
| Current log level. | |
| -bool | clutchlog::scope_t::there |
| Location is compatible. | |
-Friends | |
| std::ostream & | clutchlog::fmt::operator<< (std::ostream &os, const fmt &fmt) |
| Output stream overload. More... | |
-High-level API | |
| enum | clutchlog::level { - critical =0, -error =1, -warning =2, -progress =3, - - note =4, -info =5, -debug =6, -xdebug =7 - - } |
| Available log levels. | |
| static clutchlog & | clutchlog::logger () |
| Get the logger instance. More... | |
-Internal details | |
| -size_t | clutchlog::_strip_calls |
| Current number of call stack levels to remove from depth display. | |
| -const std::map< level, std::string > | clutchlog::_level_word |
| Dictionary of level identifier to their string representation. | |
| -std::map< std::string, level > | clutchlog::_word_level |
| Dictionary of level string to their identifier. | |
| -std::map< level, fmt > | clutchlog::_level_fmt |
| Dictionary of level identifier to their format. | |
| -std::string | clutchlog::_format_log |
| Current format of the standard output. | |
| -std::string | clutchlog::_format_dump |
| Current format of the file output. | |
| -std::ostream * | clutchlog::_out |
| Standard output. | |
| -level | clutchlog::_stage |
| Current log level. | |
| -std::regex | clutchlog::_in_file |
| Current file location filter. | |
| -std::regex | clutchlog::_in_func |
| Current function location filter. | |
| -std::regex | clutchlog::_in_line |
| Current line location filter. | |
| - | clutchlog::clutchlog (clutchlog const &)=delete |
| -void | clutchlog::operator= (clutchlog const &)=delete |
-Configuration accessors | |
| -void | clutchlog::format (const std::string &format) |
| Set the template string. | |
| -std::string | clutchlog::format () const |
| Get the template string. | |
| -void | clutchlog::format_comment (const std::string &format) |
| Set the template string for dumps. | |
| -std::string | clutchlog::format_comment () const |
| Get the template string for dumps. | |
| -void | clutchlog::out (std::ostream &out) |
| Set the output stream on which to print. | |
| -std::ostream & | clutchlog::out () |
| Get the output stream on which to print. | |
| -void | clutchlog::threshold (level l) |
| Set the log level (below which logs are not printed) with an identifier. | |
| -void | clutchlog::threshold (const std::string &l) |
| Set the log level (below which logs are not printed) with a string. | |
| -level | clutchlog::threshold () const |
| Get the log level below which logs are not printed. | |
| -const std::map< std::string, level > & | clutchlog::levels () const |
| Get the map of available log levels string representations toward their identifier. */. | |
| level | clutchlog::level_of (const std::string name) |
| Return the log level tag corresponding to the given pre-configured name. More... | |
| -void | clutchlog::file (std::string file) |
| Set the regular expression filtering the file location. | |
| -void | clutchlog::func (std::string func) |
| Set the regular expression filtering the function location. | |
| -void | clutchlog::line (std::string line) |
| Set the regular expression filtering the line location. | |
| -void | clutchlog::location (const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*") |
| Set the regular expressions filtering the location. | |
| template<class ... FMT> | |
| void | clutchlog::style (level stage, FMT... styles) |
| Set the style (color and typo) of the given log level. More... | |
| -void | clutchlog::style (level stage, fmt style) |
Set the style (color and typo) of the given log level, passing a fmt instance. | |
| -fmt | clutchlog::style (level stage) const |
| Get the configured fmt instance of the given log level. | |
-Low-level API | |
| -scope_t | clutchlog::locate (const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Gather information on the current location of the call. | |
| std::string | clutchlog::replace (const std::string &form, const std::string &mark, const std::string &tag) const |
Replace mark by tag in form. More... | |
| -std::string | clutchlog::replace (const std::string &form, const std::string &mark, const size_t tag) const |
Replace mark by tag in form, converting tag to its string representation first. | |
| -std::string | clutchlog::format (std::string format, const std::string &what, const level &stage, const std::string &file, const std::string &func, const size_t line) const |
| Substitute all tags in the format string with the corresponding information and apply the style corresponding to the log level. | |
| -void | clutchlog::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. | |
| -template<class In > | |
| void | clutchlog::dump (const level &stage, const In container_begin, const In container_end, const std::string &file, const std::string &func, size_t line, const std::string &filename_template="dump_{n}.dat", const std::string sep=dump_default_sep) const |
| Dump a serializable container after a comment line with log information. | |
-All combination of constructors with different parameters orders. | |
| - | clutchlog::fmt::fmt (fg f, bg b=bg::none, typo s=typo::none) |
| - | clutchlog::fmt::fmt (fg f, typo s, bg b=bg::none) |
| - | clutchlog::fmt::fmt (bg b, fg f=fg::none, typo s=typo::none) |
| - | clutchlog::fmt::fmt (bg b, typo s, fg f=fg::none) |
| - | clutchlog::fmt::fmt (typo s, fg f=fg::none, bg b=bg::none) |
| - | clutchlog::fmt::fmt (typo s, bg b, fg f=fg::none) |
Dump the given container.
@@ -571,7 +200,7 @@ All combination of constructors with different parameters orders.Log a message at the given level.
-
-
|
- -inline | -
Return the log level tag corresponding to the given pre-configured name.
-_level_word.
-
|
- -inlinestatic | -
Get the logger instance.
-
-
|
- -inline | -
Format the given string with the currently encoded format.
-Allow to use a formatter as a function:
-
|
- -inline | -
Replace mark by tag in form.
-
|
- -inline | -
Set the style (color and typo) of the given log level.
-This version accept style arguments as if they were passed to clutchlog::fmt.
-
|
- -friend | -
Output stream overload.
-Allow to use a formatter as a tag within a stream:
Clutchlog is a logging system that targets versatile debugging. It allows to (de)clutch messages for a given: log level, source code location or call stack depth.
@@ -114,7 +115,7 @@ FeaturesAdding a message is a simple as calling a macro (which is declutched in Debug build type, when NDEBUG is not defined):
To configure the display, you indicate the three types of locations, for example in your main function:
To configure the display, you indicate the three types of locations, for example in your main function:
Note: the log levels constants are lower case (for example: clutchlog::level::xdebug), but their string representation is not (e.g. "XDebug", this should be taken into account when using threshold or level_of).
Note: the log levels constants are lower case (for example: clutchlog::level::xdebug), but their string representation is not (e.g. "XDebug", this should be taken into account when using clutchlog::threshold or clutchlog::level_of).
To configure the global behaviour of the logger, you must first get a reference on its (singleton) instance:
To configure the global behaviour of the logger, you must first get a reference on its (singleton) instance:
One can configure the location(s) at which messages should actually be logged:
Current levels are defined in an enumeration as clutchlog::level:
Current levels are defined in an enumeration as clutchlog::level:
File, function and line filters are indicated using (ECMAScript) regular expressions:
Note that the case of the log levels strings matters (see below).
The output stream can be configured using the out method:
The format of the messages can be defined with the format method, passing a string with standardized tags surrounded by {}:
The output stream can be configured using the clutchlog::out method:
The format of the messages can be defined with the clutchlog::format method, passing a string with standardized tags surrounded by {}:
Available tags are:
{msg}: the logged message,{level_letter}: the first letter of the current log level,{file}: the current file (absolute path),{func}: the current function,{line}: the current line number.{line}: the current line number,{level_fmt}: the format of the current level (i.e. configured with clutchlog::style).Some tags are only available on POSIX operating systems as of now:
{name}: the name of the current binary,By default, and if CLUTCHLOG_DEFAULT_FORMAT is not defined, clutchlog will not put the location-related tags in the message formats (i.e. {name}, {func}, and {line}) when not in Debug builds.
The output can be colored differently depending on the log level.
Output lines can be colored differently depending on the log level.
Using the clutchlog::fmt class, you can style:
Note: this inserts a style marker at the very beginning of the line. If you add other styles later on the line, they will take precedence.
+Using the clutchlog::fmt class, you can style:
clutchlog::fmt::fg,clutchlog::fmt::bg,clutchlog::fmt::typo.clutchlog::fmt::fg,clutchlog::fmt::bg,clutchlog::fmt::typo.Any of the three arguments may be passed, in any order, if an argument is omitted, it defaults to no color/style.
Available colors are:
@@ -243,8 +246,9 @@ Output styleNote: messages at the "critical", "error" and "warning" log levels are colored by default. You may want to set their style to none if you want to stay in control of inserted colors in the format template.
The horizontal filling line (the {hfill} tag) can be configured separately with hfill_style, for example:
The horizontal filling line (the {hfill} tag) can be configured separately with clutchlog::hfill_style, for example:
Note: this will actually reset any styling after the hfill, disabling any style you would have set for the whole message using clutchlog::format for the remaining of the message.
By default, the separator between items in the container is a new line. To change this behaviour, you can change CLUTCHDUMP_DEFAULT_SEP or call the low-level dump method.
By default, and if CLUTCHDUMP_DEFAULT_FORMAT is not defined, clutchlog will not put the location-related tags in the message formats (i.e. {file} and {line}) when not in Debug builds.
The mark used with the {depth_marks} tag can be configured with the depth_mark method, and its default with the CLUTCHLOG_DEFAULT_DEPTH_MARK macro:
The character used with the {hfill} tag can be configured wth the hfill_mark method, and its default with the CLUTCHLOG_DEFAULT_HFILL_MARK macro:
Clutchlog measures the width of the standard error channel. If it is redirected, it may be measured as very large. Thus, the hfill_max accessors allow to set a maximum width (in number of characters).
Note: clutchlog will select the minimum between hfill_max and the measured number of columns in the terminal, so that you may use hfill_max as a way to constraint the output width in any cases.
The mark used with the {depth_marks} tag can be configured with the clutchlog::depth_mark method, and its default with the CLUTCHLOG_DEFAULT_DEPTH_MARK macro:
The character used with the {hfill} tag can be configured wth the clutchlog::hfill_mark method, and its default with the CLUTCHLOG_DEFAULT_HFILL_MARK macro:
Clutchlog measures the width of the standard error channel. If it is redirected, it may be measured as very large. Thus, the clutchlog::hfill_max accessors allow to set a maximum width (in number of characters).
Note: clutchlog will select the minimum between clutchlog::hfill_max and the measured number of columns in the terminal, so that you may use clutchlog::hfill_max as a way to constraint the output width in any cases.
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, or calling strip_calls.
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, or calling clutchlog::strip_calls.
By default, clutchlog is always enabled if the NDEBUG preprocessor variable is not defined (this variable is set by CMake in build types that differs from Debug).
All configuration setters have a getters counterpart, with the same name but taking no parameter, for example:
To control more precisely the logging, one can use the low-level log method:
To control more precisely the logging, one can use the low-level clutchlog::log method:
A helper macro can helps to fill in the location with the actual one, as seen by the compiler:
A similar dump method exists:
You can access the identifier of log levels with level_of:
You can access the identifier of log levels with clutchlog::level_of:
The CLUTHFUNC macro allows to wrap any function within the current logger.
Here what you would do to setup clutchlog with the default configuration:
Here what you would do to setup clutchlog with the default configuration:
And here are all the functions you may call to log something: ```cpp // Basic message. CLUTCHLOG(debug, "x = " << x);
-// Any code section. CLUTCHCODE(xdebug, if(x < 0) std::cerr << "WTF?" << std::endl; );
-// Container to a file. CLUTCHDUMP(note, my_vector, "my_vector.dat");
-// Container to a numbered file. CLUTCHDUMP(note, my_list, "my_list_{n}.dat");
-// Function call. CLUTCHFUNC(warning, my_check, x, y); // Calls my_check(x,y);
// Declutchable asserts. #define ASSERT(...) { CLUTCHFUNC(critical, assert, VA_ARGS) } ASSERT(x>0);
And here are all the functions you may call to log something:
Because access to the call stack depth and program name are system-dependent, the features relying on the depth of the call stack and the display of the program name are only available for operating systems having the following headers: execinfo.h, stdlib.h and libgen.h (so far, tested with Linux).
Clutchlog sets the CLUTCHLOG_HAVE_UNIX_SYSINFO to 1 if the headers are available, and to 0 if they are not. You can make portable code using something like:
Because access to the current terminal width is system-dependent, the {hfill} format tag feature is only available for operating systems having the following headers: sys/ioctl.h, stdio.h and unistd.h (so far, tested with Linux).
Clutchlog sets the CLUTCHLOG_HAVE_UNIX_SYSIOCTL to 1 if the headers are available, and to 0 if they are not. You can make portable code using something like:
To use clutchlog, just include its header in your code and either ensure that the NDEBUG preprocessor variable is not set, either define the WITH_CLUTCHLOG preprocessor variable.
If you're using CMake (or another modern build system), it will unset NDEBUG —and thus enable clutchlog— only for the "Debug" build type, which is usually what you want if you use clutchlog, anyway.
There's a script that tests all the build types combinations: ./build_all.sh.
| Default configuration macros | |
| ▼High-level API macros | |
| Formating tools | |
| Main class | The single class which holds everything |
| Default configuration management | |
| High-level API macros | |
| Main class | |
| Formating tools |
This is the complete list of members for clutchlog::scope_t, including all inherited members.
Public Member Functions | |
| - | scope_t () |
| Constructor. | |
| + | scope_t () |
| Constructor. | |
Public Attributes | |
| -bool | matches |
| Everything is compatible. | |
| -level | stage |
| Current log level. | |
| -bool | there |
| Location is compatible. | |
| +bool | matches |
| Everything is compatible. | |
| +level | stage |
| Current log level. | |
| +bool | there |
| Location is compatible. | |
Structure holding a location matching.