Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8d148cf97 | ||
|
|
28f50d0bad |
1 changed files with 16 additions and 2 deletions
|
|
@ -32,6 +32,7 @@
|
||||||
#define CLUTCHLOG_HAVE_UNIX_SYSINFO 1
|
#define CLUTCHLOG_HAVE_UNIX_SYSINFO 1
|
||||||
#else
|
#else
|
||||||
#define CLUTCHLOG_HAVE_UNIX_SYSINFO 0
|
#define CLUTCHLOG_HAVE_UNIX_SYSINFO 0
|
||||||
|
// #pragma message("[clutchlog] no POSIX SYSINFO header")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! True if the system can handle the `hfill` feature.
|
//! True if the system can handle the `hfill` feature.
|
||||||
|
|
@ -42,6 +43,7 @@
|
||||||
#define CLUTCHLOG_HAVE_UNIX_SYSIOCTL 1
|
#define CLUTCHLOG_HAVE_UNIX_SYSIOCTL 1
|
||||||
#else
|
#else
|
||||||
#define CLUTCHLOG_HAVE_UNIX_SYSIOCTL 0
|
#define CLUTCHLOG_HAVE_UNIX_SYSIOCTL 0
|
||||||
|
// #pragma message("[clutchlog] no POSIX SYSIOCTL header")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -52,7 +54,12 @@
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
//! Actually enable clutchlog features.
|
//! Actually enable clutchlog features.
|
||||||
#define WITH_CLUTCHLOG
|
#define WITH_CLUTCHLOG
|
||||||
|
// #pragma message("[clutchlog] automatically enabled")
|
||||||
|
// #else
|
||||||
|
// #pragma message("[clutchlog] automatically disabled")
|
||||||
#endif
|
#endif
|
||||||
|
// #else
|
||||||
|
// #pragma message("[clutchlog] manually enabled")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
@ -171,6 +178,7 @@
|
||||||
#define CLUTCHDUMP( LEVEL, CONTAINER, FILENAME ) do {/*nothing*/} while(0)
|
#define CLUTCHDUMP( LEVEL, CONTAINER, FILENAME ) do {/*nothing*/} while(0)
|
||||||
#define CLUTCHFUNC( LEVEL, FUNC, ... ) do {/*nothing*/} while(0)
|
#define CLUTCHFUNC( LEVEL, FUNC, ... ) do {/*nothing*/} while(0)
|
||||||
#define CLUTCHCODE( LEVEL, CODE ) do {/*nothing*/} while(0)
|
#define CLUTCHCODE( LEVEL, CODE ) do {/*nothing*/} while(0)
|
||||||
|
// #pragma message("[clutchlog] fully disabled")
|
||||||
#endif // WITH_CLUTCHLOG
|
#endif // WITH_CLUTCHLOG
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
@ -999,7 +1007,9 @@ class clutchlog
|
||||||
|
|
||||||
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
|
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
|
||||||
//! Set the stack depth above which logs are not printed.
|
//! Set the stack depth above which logs are not printed.
|
||||||
void depth(size_t d) {_depth = d;}
|
void depth(size_t d) {
|
||||||
|
_depth = std::min(d, std::numeric_limits<size_t>::max() - _strip_calls);
|
||||||
|
}
|
||||||
//! Get the stack depth above which logs are not printed.
|
//! Get the stack depth above which logs are not printed.
|
||||||
size_t depth() const {return _depth;}
|
size_t depth() const {return _depth;}
|
||||||
|
|
||||||
|
|
@ -1333,7 +1343,10 @@ class clutchlog
|
||||||
row = replace(row, "\\{level_short\\}", _level_short.at(stage));
|
row = replace(row, "\\{level_short\\}", _level_short.at(stage));
|
||||||
|
|
||||||
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
|
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
|
||||||
size_t actual_depth = depth - _strip_calls;
|
size_t actual_depth = 0;
|
||||||
|
if( _strip_calls < depth) {
|
||||||
|
actual_depth = depth - _strip_calls;
|
||||||
|
}
|
||||||
row = replace(row, "\\{name\\}", name);
|
row = replace(row, "\\{name\\}", name);
|
||||||
row = replace(row, "\\{depth\\}", actual_depth);
|
row = replace(row, "\\{depth\\}", actual_depth);
|
||||||
|
|
||||||
|
|
@ -1358,6 +1371,7 @@ class clutchlog
|
||||||
row = replace(row, "\\{depth_marks\\}", chevrons.str());
|
row = replace(row, "\\{depth_marks\\}", chevrons.str());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
row = replace(row, "\\{level_fmt\\}", _level_fmt.at(stage).str());
|
row = replace(row, "\\{level_fmt\\}", _level_fmt.at(stage).str());
|
||||||
row = replace(row, "\\{filehash_fmt\\}", fmt::hash(file, _filehash_fmts).str() );
|
row = replace(row, "\\{filehash_fmt\\}", fmt::hash(file, _filehash_fmts).str() );
|
||||||
row = replace(row, "\\{funchash_fmt\\}", fmt::hash(func, _funchash_fmts).str() );
|
row = replace(row, "\\{funchash_fmt\\}", fmt::hash(func, _funchash_fmts).str() );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue