fix: portability patch for OS other than Linux

- Test for sys headers and disable depth/name if not found
- Update the doc and bump to 0.3.
This commit is contained in:
Johann Dreo 2020-09-19 18:20:07 +02:00
commit 3a4bdc0d57
4 changed files with 85 additions and 19 deletions

View file

@ -27,31 +27,41 @@ int main(/*const int argc, char* argv[]*/)
log.out(std::clog);
std::clog << "depth: 99; threshold: xdebug; location: .*" << std::endl;
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
log.depth(99);
#endif
log.threshold(clutchlog::level::xdebug);
log.location(".*",".*");
f();
std::clog << "depth: 4; threshold: xdebug; location: ,*" << std::endl;
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
log.depth(4);
#endif
log.threshold(clutchlog::level::xdebug);
log.location(".*");
f();
std::clog << "depth: 99; threshold: warning; location: .*" << std::endl;
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
log.depth(99);
#endif
log.threshold(clutchlog::level::warning);
log.location(".*");
f();
std::clog << "depth: 99; threshold: xdebug; location: 'core','g'" << std::endl;
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
log.depth(99);
#endif
log.threshold(clutchlog::level::xdebug);
log.location("core","g");
f();
std::clog << "depth: 99; threshold: debug; location: '.*','(g|h)'" << std::endl;
#if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
log.depth(99);
#endif
log.threshold(clutchlog::level::debug);
log.location(".*","(g|h)");
f();