From 669525c1d4f4e022b8c24364f246aa01243f0712 Mon Sep 17 00:00:00 2001 From: nojhan Date: Wed, 7 Sep 2022 22:55:15 +0200 Subject: [PATCH] update doc --- docs/annotated.html | 2 +- docs/classclutchlog-members.html | 34 +- docs/classclutchlog.html | 18 +- docs/classclutchlog_1_1fmt-members.html | 2 +- docs/classclutchlog_1_1fmt.html | 2 +- docs/classes.html | 2 +- docs/clutchlog_8h.html | 5 +- docs/clutchlog_8h_source.html | 1427 +++++++++-------- docs/dir_000062_000000.html | 2 +- .../dir_0597ce40fdf188e7870807c32590691d.html | 2 +- .../dir_084dfc9a5a5be3c9e27543ac1f550db2.html | 2 +- .../dir_0c6859326e57c84153d9ce3980c7b614.html | 2 +- .../dir_10ddb028b6670bd8aa01364e6cad76a9.html | 2 +- .../dir_10e5b046fa80f4154fb6ef98b74319ee.html | 2 +- .../dir_11d96b0893f97b142d6effd564752a90.html | 2 +- .../dir_13368ad9184bbad1002e036a402da7c4.html | 2 +- .../dir_14f0b626af56b1ff4afcbb0dad5c9b00.html | 2 +- .../dir_178d547a078d4731b3af021ed5ed0bd5.html | 2 +- .../dir_183919ee65eb1ce3e4c28765d02d1592.html | 2 +- .../dir_2010fee6dc55af84ec3880814fe9859d.html | 2 +- .../dir_232d0e660737fa098457ae695f029c6e.html | 2 +- .../dir_27117ea8c3a88700c8b1db11c9562238.html | 2 +- .../dir_2c58f47b9ec63c233e9a6dc44b0220ce.html | 2 +- .../dir_3353b0403823e43b133a3a97f7b61528.html | 2 +- .../dir_3354f823b93c486985d8eff812f202d0.html | 2 +- .../dir_3580e889fffd597e9f1e74f0989be3f4.html | 2 +- .../dir_38468fa15d001d8f53eb5a2cc819fc4d.html | 2 +- .../dir_3b27b7a7434122ddfe41170c43d31183.html | 2 +- .../dir_3b3b5af829689cf9fc261f0e6a0edda6.html | 2 +- .../dir_3e1bb72ed66f215303e7248107b2c843.html | 2 +- .../dir_3e4d9bbf23e4011a0d79c59ef1fbe4fa.html | 2 +- .../dir_44d46ce0fefad9fb4568613342a0f089.html | 2 +- .../dir_49bf50162b43c6eb0e5d51c9a154dd85.html | 2 +- .../dir_56412180890141897a46e337654f67d2.html | 2 +- .../dir_56a467a6a3c52bfafa193ec205c1fdda.html | 2 +- .../dir_581e3e812319f368929566c0af58ce01.html | 2 +- .../dir_59425e443f801f1f2fd8bbe4959a3ccf.html | 2 +- .../dir_5b4d8a0ca6574b7df09df571ad9e67b6.html | 2 +- .../dir_61ab004aa8225a3da30151b57198e21f.html | 2 +- .../dir_758abd5d6f4fa812820adbe21fc77736.html | 2 +- .../dir_7993767c315ca7e2492c0e12f2140894.html | 2 +- .../dir_7ac2ccaca1f97cd5484903d036e6e018.html | 2 +- .../dir_7bfd87e22fd8913a7cdac6885aea0fda.html | 2 +- .../dir_7cb602820ef60ce7eb9af6d9eb8de17a.html | 2 +- .../dir_818a2d2dcebf5fa9f09b2ff370a5de12.html | 2 +- .../dir_8497d690b57aba136d1839e5c427d666.html | 2 +- .../dir_894f8a189fd86151cf73b234a425a3d7.html | 2 +- .../dir_8a6224de47695006c09a16d36b73e641.html | 2 +- .../dir_8c3cbcfef903547985c71f28526a37d7.html | 2 +- .../dir_99be30a3dc5b3fd221ff5ea6bdbc52f4.html | 2 +- .../dir_99f269110bdc8201794420d5043dadef.html | 2 +- .../dir_9a935cfcf36ab9c047ca734a48c6ea47.html | 2 +- .../dir_a5e190e82988878b02be1ad8893fe33a.html | 2 +- .../dir_a6147547081efd8e9250c1acee302c56.html | 2 +- .../dir_a808995e8af62dcd5e402dfccd15597d.html | 2 +- .../dir_a943a781f3047d1fe445d5e8eba50028.html | 2 +- .../dir_b1c763aea5b862e235cc9501e2ce06da.html | 2 +- .../dir_b2c0fc6d3625db437ca13cb01c2a2d25.html | 2 +- .../dir_be65af4ad555fa38f52fdec43511df23.html | 2 +- .../dir_bf56be71754e1b48f8f3e417eb89bb69.html | 2 +- .../dir_c318bd5cf14aaa5601e6029e0b5b4048.html | 2 +- .../dir_c6d9c1238235b0a4853a9dfbf2961dcc.html | 2 +- .../dir_c9d710504e3415cd6c2884f7df804eda.html | 2 +- .../dir_dd500134467ec65427366f3cbbc5ff81.html | 2 +- .../dir_de06b53c2e04c67b773395f92873ff7f.html | 2 +- .../dir_e486d5210108a359e139a984535147fa.html | 2 +- .../dir_ec4f48f1c0ac567d297185d46cf69b0c.html | 2 +- .../dir_ede0e87241159758c1b375c196bd55d8.html | 2 +- .../dir_f324b8056e3921282ea6aa7d15c7705c.html | 2 +- .../dir_f544411fb6a30872da080b65ab4522b8.html | 2 +- .../dir_f792a45ec812fbfe638a4ac0a7328817.html | 2 +- .../dir_f803ec176eda9a8494dc55dc57236527.html | 2 +- docs/files.html | 2 +- docs/functions.html | 10 +- docs/functions_enum.html | 2 +- docs/functions_func.html | 2 +- docs/functions_rela.html | 2 +- docs/functions_vars.html | 10 +- docs/globals.html | 2 +- docs/globals_defs.html | 2 +- docs/graph_legend.html | 2 +- docs/group__DefaultConfigMacros.html | 2 +- docs/group__Formating.html | 2 +- docs/group__Main.html | 2 +- docs/group__UseMacros.html | 24 +- docs/index.html | 117 +- docs/modules.html | 2 +- docs/search/all_0.js | 19 +- docs/search/all_1.js | 4 +- docs/search/all_2.js | 30 +- docs/search/all_3.js | 7 +- docs/search/variables_0.js | 19 +- docs/search/variables_1.js | 2 +- docs/search/variables_2.js | 7 +- docs/structclutchlog_1_1scope__t-members.html | 2 +- docs/structclutchlog_1_1scope__t.html | 2 +- 96 files changed, 994 insertions(+), 901 deletions(-) diff --git a/docs/annotated.html b/docs/annotated.html index f498a19..5b0d657 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -22,7 +22,7 @@
clutchlog -  0.8 +  0.9
diff --git a/docs/classclutchlog-members.html b/docs/classclutchlog-members.html index 1c9fa81..b374d91 100644 --- a/docs/classclutchlog-members.html +++ b/docs/classclutchlog-members.html @@ -22,7 +22,7 @@
clutchlog -  0.8 +  0.9
@@ -71,22 +71,22 @@ $(function() { - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/docs/classclutchlog.html b/docs/classclutchlog.html index a47de9a..61104fc 100644 --- a/docs/classclutchlog.html +++ b/docs/classclutchlog.html @@ -22,7 +22,7 @@ @@ -206,6 +206,10 @@ static unsigned int  + + +
_format_dumpclutchlogprotected
_format_logclutchlogprotected
_hfill_charclutchlogprotected
_in_fileclutchlogprotected
_in_funcclutchlogprotected
_in_lineclutchlogprotected
_level_fmtclutchlogprotected
_level_wordclutchlogprotected
_outclutchlogprotected
_stageclutchlogprotected
_strip_callsclutchlogprotected
_word_levelclutchlogprotected
clutchlog(clutchlog const &)=delete (defined in clutchlog)clutchlog
critical enum value (defined in clutchlog)clutchlog
debug enum value (defined in clutchlog)clutchlog
default_depth_markclutchloginlineprotectedstatic
default_formatclutchloginlineprotectedstatic
default_hfill_charclutchloginlineprotectedstatic
_in_fileclutchlogprotected
_in_funcclutchlogprotected
_in_lineclutchlogprotected
_level_fmtclutchlogprotected
_level_wordclutchlogprotected
_outclutchlogprotected
_stageclutchlogprotected
_strip_callsclutchlogprotected
_word_levelclutchlogprotected
clutchlog(clutchlog const &)=delete (defined in clutchlog)clutchlog
critical enum value (defined in clutchlog)clutchlog
debug enum value (defined in clutchlog)clutchlog
default_depth_markclutchloginlineprotectedstatic
default_formatclutchloginlineprotectedstatic
default_hfill_charclutchloginlineprotectedstatic
default_hfill_maxclutchloginlineprotectedstatic
default_strip_callsclutchloginlineprotectedstatic
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) constclutchloginline
dump_default_formatclutchloginlineprotectedstatic
clutchlog -  0.8 +  0.9
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}".
 
@@ -229,10 +233,10 @@ High-level API

High-level API

- - - + + + @@ -253,10 +257,6 @@ std::string  - - - diff --git a/docs/classclutchlog_1_1fmt-members.html b/docs/classclutchlog_1_1fmt-members.html index a9dfdb4..d321788 100644 --- a/docs/classclutchlog_1_1fmt-members.html +++ b/docs/classclutchlog_1_1fmt-members.html @@ -22,7 +22,7 @@ diff --git a/docs/classclutchlog_1_1fmt.html b/docs/classclutchlog_1_1fmt.html index 6e62977..65c2fc4 100644 --- a/docs/classclutchlog_1_1fmt.html +++ b/docs/classclutchlog_1_1fmt.html @@ -22,7 +22,7 @@ diff --git a/docs/classes.html b/docs/classes.html index 2dd44b4..20cb59d 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -22,7 +22,7 @@ diff --git a/docs/clutchlog_8h.html b/docs/clutchlog_8h.html index 3cfe27e..ade8be9 100644 --- a/docs/clutchlog_8h.html +++ b/docs/clutchlog_8h.html @@ -22,7 +22,7 @@ @@ -119,6 +119,9 @@ Classes

Internal details

-const size_t _strip_calls
 Current number of call stack levels to remove from depth display.
 
+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.
_format_dump
 Current format of the file output.
 
-char _hfill_char
 Character for filling.
 
std::ostream * _out
 Standard output.
clutchlog -  0.8 +  0.9
clutchlog -  0.8 +  0.9
clutchlog -  0.8 +  0.9
clutchlog -  0.8 +  0.9
+ + diff --git a/docs/clutchlog_8h_source.html b/docs/clutchlog_8h_source.html index c47e305..ce0e318 100644 --- a/docs/clutchlog_8h_source.html +++ b/docs/clutchlog_8h_source.html @@ -22,7 +22,7 @@ @@ -70,9 +70,9 @@ $(function() {
clutchlog.h
-Go to the documentation of this file.
1 #ifndef __CLUTCHLOG_H__
-
2 #define __CLUTCHLOG_H__
-
3 #pragma once
+Go to the documentation of this file.
1 #pragma once
+
2 #ifndef CLUTCHLOG_H
+
3 #define CLUTCHLOG_H
4 
6 #include <ciso646>
7  #ifdef FSEXPERIMENTAL
@@ -241,7 +241,7 @@ $(function() {
198  #else
199  #ifndef CLUTCHLOG_DEFAULT_FORMAT
200  #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
202  #define CLUTCHLOG_DEFAULT_FORMAT "{level_letter}:{depth_marks} {msg} {hfill} {func}\n"
+
202  #define CLUTCHLOG_DEFAULT_FORMAT "[{name}] {level_letter}:{depth_marks} {msg} {hfill} {func}\n"
203  #else
204  #define CLUTCHLOG_DEFAULT_FORMAT "{level_letter} {msg}\t\t\t\t\t{func}\n"
205  #endif
@@ -287,724 +287,767 @@ $(function() {
255  #define CLUTCHLOG_HFILL_MARK '.'
257  #endif // CLUTCHLOG_HFILL_MARK
258  static inline char default_hfill_char = CLUTCHLOG_HFILL_MARK;
-
260  /* @} */
+
260 
261 
-
262 
-
263  public:
-
273  static clutchlog& logger()
-
274  {
-
275  static clutchlog instance;
-
276  return instance;
-
277  }
-
278 
-
280  enum level {critical=0, error=1, warning=2, progress=3, note=4, info=5, debug=6, xdebug=7};
-
281 
-
294  class fmt {
-
295  public:
-
297  enum class fg {
-
298  black = 30,
-
299  red = 31,
-
300  green = 32,
-
301  yellow = 33,
-
302  blue = 34,
-
303  magenta = 35,
-
304  cyan = 36,
-
305  white = 37,
-
306  none
-
307  } fore;
-
308 
-
310  enum class bg {
-
311  black = 40,
-
312  red = 41,
-
313  green = 42,
-
314  yellow = 43,
-
315  blue = 44,
-
316  magenta = 45,
-
317  cyan = 46,
-
318  white = 47,
+
262  #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL == 1
+
263  #ifndef CLUTCHLOG_HFILL_MAX
+
264  #define CLUTCHLOG_HFILL_MAX 300
+
265  #endif
+
266  #endif
+
267  static inline unsigned short default_hfill_max = CLUTCHLOG_HFILL_MAX;
+
269 
+
270  // NOTE: there is no CLUTCHLOG_HFILL_STYLE for defaulting,
+
271  // but you can still set `hfill_style(...)` on the logger singleton.
+
272  /* @} */
+
273 
+
274 
+
275  public:
+
276 
+
286  static clutchlog& logger()
+
287  {
+
288  static clutchlog instance;
+
289  return instance;
+
290  }
+
291 
+
293  enum level {critical=0, error=1, warning=2, progress=3, note=4, info=5, debug=6, xdebug=7};
+
294 
+
307  class fmt {
+
308  public:
+
310  enum class fg {
+
311  black = 30,
+
312  red = 31,
+
313  green = 32,
+
314  yellow = 33,
+
315  blue = 34,
+
316  magenta = 35,
+
317  cyan = 36,
+
318  white = 37,
319  none
-
320  } back;
+
320  } fore;
321 
-
323  enum class typo {
-
324  reset = 0,
-
325  bold = 1,
-
326  underline = 4,
-
327  inverse = 7,
-
328  none
-
329  } style;
-
330 
-
332  fmt() : fore(fg::none), back(bg::none), style(typo::none) {}
-
333 
-
336  fmt( fg f, bg b = bg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
-
337  fmt( fg f, typo s , bg b = bg::none) : fore(f), back(b), style(s) {}
-
338  fmt( bg b, fg f = fg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
-
339  fmt( bg b, typo s , fg f = fg::none) : fore(f), back(b), style(s) {}
-
340  fmt(typo s, fg f = fg::none, bg b = bg::none) : fore(f), back(b), style(s) {}
-
341  fmt(typo s, bg b , fg f = fg::none) : fore(f), back(b), style(s) {}
-
344  protected:
-
346  std::ostream& print_on( std::ostream& os) const
-
347  {
-
348  std::vector<int> codes; codes.reserve(3);
-
349  if(this->fore != fg::none) { codes.push_back(static_cast<int>(this->fore ));}
-
350  if(this->back != bg::none) { codes.push_back(static_cast<int>(this->back ));}
-
351  if(this->style != typo::none) { codes.push_back(static_cast<int>(this->style));}
-
352  if(codes.size() == 0) {return os;}
-
353 
-
354  os << "\033[";
-
355  assert(codes.size() > 0);
-
356  os << codes[0];
-
357  for(size_t i=1; i < codes.size(); ++i) {
-
358  os << ";" << codes[i];
-
359  }
-
360  os << "m";
-
361  return os;
-
362  }
-
363 
-
364  public:
-
376  friend std::ostream& operator<<(std::ostream& os, const fmt& fmt)
-
377  {
-
378  return fmt.print_on(os);
-
379  }
-
380 
-
391  std::string operator()( const std::string& msg ) const
-
392  {
-
393  std::ostringstream os;
-
394  this->print_on(os);
-
395  fmt reset(fmt::typo::reset);
-
396  os << msg;
-
397  reset.print_on(os);
-
398  return os.str();
-
399  }
-
400  }; // fmt class
-
401 
-
408  public:
-
409  clutchlog(clutchlog const&) = delete;
-
410  void operator=(clutchlog const&) = delete;
-
411 
-
412  private:
-
413  clutchlog() :
-
414  // system, main, log
- -
416  _level_word({
-
417  {level::critical,"Critical"},
-
418  {level::error ,"Error"},
-
419  {level::warning ,"Warning"},
-
420  {level::progress,"Progress"},
-
421  {level::note ,"Note"},
-
422  {level::info ,"Info"},
-
423  {level::debug ,"Debug"},
-
424  {level::xdebug ,"XDebug"}
-
425  }),
-
426  _level_fmt({
-
427  {level::critical,fmt(fmt::fg::red, fmt::typo::underline)},
-
428  {level::error ,fmt(fmt::fg::red, fmt::typo::bold)},
-
429  {level::warning ,fmt(fmt::fg::magenta, fmt::typo::bold)},
-
430  {level::progress,fmt()},
-
431  {level::note ,fmt()},
-
432  {level::info ,fmt()},
-
433  {level::debug ,fmt()},
-
434  {level::xdebug ,fmt()}
-
435  }),
- - - -
439  _out(&std::clog),
-
440 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
441  _depth(std::numeric_limits<size_t>::max() - _strip_calls),
-
442  _depth_mark(clutchlog::default_depth_mark),
-
443 #endif
-
444  _stage(level::error),
-
445  _in_file(".*"),
-
446  _in_func(".*"),
-
447  _in_line(".*")
-
448  {
-
449  // Reverse the level->word map into a word->level map.
-
450  for(auto& lw : _level_word) {
-
451  _word_level[lw.second] = lw.first;
-
452  }
-
453 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
-
454  struct winsize w;
-
455  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
-
456  _nb_columns = w.ws_col;
-
457 #endif
-
458  }
-
459 
-
460  protected:
-
462  const size_t _strip_calls;
-
464  const std::map<level,std::string> _level_word;
-
466  std::map<std::string,level> _word_level;
-
468  std::map<level,fmt> _level_fmt;
-
470  std::string _format_log;
-
472  std::string _format_dump;
- -
476  std::ostream* _out;
-
477 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
478 
-
479  size_t _depth;
-
481  std::string _depth_mark;
-
482 #endif
-
483 
- -
486  std::regex _in_file;
-
488  std::regex _in_func;
-
490  std::regex _in_line;
+
323  enum class bg {
+
324  black = 40,
+
325  red = 41,
+
326  green = 42,
+
327  yellow = 43,
+
328  blue = 44,
+
329  magenta = 45,
+
330  cyan = 46,
+
331  white = 47,
+
332  none
+
333  } back;
+
334 
+
336  enum class typo {
+
337  reset = 0,
+
338  bold = 1,
+
339  underline = 4,
+
340  inverse = 7,
+
341  none
+
342  } style;
+
343 
+
345  fmt() : fore(fg::none), back(bg::none), style(typo::none) {}
+
346 
+
349  fmt( fg f, bg b = bg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
+
350  fmt( fg f, typo s , bg b = bg::none) : fore(f), back(b), style(s) {}
+
351  fmt( bg b, fg f = fg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
+
352  fmt( bg b, typo s , fg f = fg::none) : fore(f), back(b), style(s) {}
+
353  fmt(typo s, fg f = fg::none, bg b = bg::none) : fore(f), back(b), style(s) {}
+
354  fmt(typo s, bg b , fg f = fg::none) : fore(f), back(b), style(s) {}
+
357  protected:
+
359  std::ostream& print_on( std::ostream& os) const
+
360  {
+
361  std::vector<int> codes; codes.reserve(3);
+
362  if(this->fore != fg::none) { codes.push_back(static_cast<int>(this->fore ));}
+
363  if(this->back != bg::none) { codes.push_back(static_cast<int>(this->back ));}
+
364  if(this->style != typo::none) { codes.push_back(static_cast<int>(this->style));}
+
365  if(codes.size() == 0) {return os;}
+
366 
+
367  os << "\033[";
+
368  assert(codes.size() > 0);
+
369  os << codes[0];
+
370  for(size_t i=1; i < codes.size(); ++i) {
+
371  os << ";" << codes[i];
+
372  }
+
373  os << "m";
+
374  return os;
+
375  }
+
376 
+
377  public:
+
389  friend std::ostream& operator<<(std::ostream& os, const fmt& fmt)
+
390  {
+
391  return fmt.print_on(os);
+
392  }
+
393 
+
404  std::string operator()( const std::string& msg ) const
+
405  {
+
406  std::ostringstream os;
+
407  this->print_on(os);
+
408  fmt reset(fmt::typo::reset);
+
409  os << msg;
+
410  reset.print_on(os);
+
411  return os.str();
+
412  }
+
413  }; // fmt class
+
414 
+
421  public:
+
422  clutchlog(clutchlog const&) = delete;
+
423  void operator=(clutchlog const&) = delete;
+
424 
+
425  private:
+
426  clutchlog() :
+
427  // system, main, log
+ +
429  _level_word({
+
430  {level::critical,"Critical"},
+
431  {level::error ,"Error"},
+
432  {level::warning ,"Warning"},
+
433  {level::progress,"Progress"},
+
434  {level::note ,"Note"},
+
435  {level::info ,"Info"},
+
436  {level::debug ,"Debug"},
+
437  {level::xdebug ,"XDebug"}
+
438  }),
+
439  _level_fmt({
+
440  {level::critical,fmt(fmt::fg::red, fmt::typo::underline)},
+
441  {level::error ,fmt(fmt::fg::red, fmt::typo::bold)},
+
442  {level::warning ,fmt(fmt::fg::magenta, fmt::typo::bold)},
+
443  {level::progress,fmt()},
+
444  {level::note ,fmt()},
+
445  {level::info ,fmt()},
+
446  {level::debug ,fmt()},
+
447  {level::xdebug ,fmt()}
+
448  }),
+ + +
451  #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
+
452  _hfill_char(clutchlog::default_hfill_char),
+
453  _hfill_fmt(fmt::fg::none),
+
454  _hfill_max(clutchlog::default_hfill_max),
+
455  #endif
+
456  _out(&std::clog),
+
457  #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
458  _depth(std::numeric_limits<size_t>::max() - _strip_calls),
+
459  _depth_mark(clutchlog::default_depth_mark),
+
460  #endif
+
461  _stage(level::error),
+
462  _in_file(".*"),
+
463  _in_func(".*"),
+
464  _in_line(".*")
+
465  {
+
466  // Reverse the level->word map into a word->level map.
+
467  for(auto& lw : _level_word) {
+
468  _word_level[lw.second] = lw.first;
+
469  }
+
470 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
+
471  struct winsize w;
+
472  ioctl(STDERR_FILENO, TIOCGWINSZ, &w);
+
473  _nb_columns = std::min(w.ws_col, default_hfill_max);
+
474 #endif
+
475  }
+
476 
+
477  protected:
+
479  size_t _strip_calls;
+
481  const std::map<level,std::string> _level_word;
+
483  std::map<std::string,level> _word_level;
+
485  std::map<level,fmt> _level_fmt;
+
487  std::string _format_log;
+
489  std::string _format_dump;
+
490  #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
491 
-
492 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
493 
-
494  static const size_t _max_buffer = 4096;
-
495 #endif
-
496 
-
497 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
+
492  char _hfill_char;
+
494  fmt _hfill_fmt;
+
496  unsigned short _hfill_max;
+
497  #endif
498 
-
499  size_t _nb_columns;
-
500 #endif
+
499  std::ostream* _out;
+
500  #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
501 
-
503  public:
-
504 
-
508  void format(const std::string& format) {_format_log = format;}
-
511  std::string format() const {return _format_log;}
-
512 
-
514  void format_comment(const std::string& format) {_format_dump = format;}
-
516  std::string format_comment() const {return _format_dump;}
-
517 
-
519  void out(std::ostream& out) {_out = &out;}
-
521  std::ostream& out() {return *_out;}
-
522 
-
523 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
524  void depth(size_t d) {_depth = d;}
-
527  size_t depth() const {return _depth;}
-
528 
-
530  void depth_mark(const std::string mark) {_depth_mark = mark;}
-
532  std::string depth_mark() const {return _depth_mark;}
-
533 #endif
-
534 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL == 1
-
535  void hfill_mark(const char mark) {_hfill_char = mark;}
-
538  char hfill_mark() const {return _hfill_char;}
-
539 #endif
+
502  size_t _depth;
+
504  std::string _depth_mark;
+
505  #endif
+
506 
+ +
509  std::regex _in_file;
+
511  std::regex _in_func;
+
513  std::regex _in_line;
+
514 
+
515 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
516 
+
517  static const size_t _max_buffer = 4096;
+
518 #endif
+
519 
+
520 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
+
521 
+
522  size_t _nb_columns;
+
523 #endif
+
524 
+
526  public:
+
527 
+
531  void format(const std::string& format) {_format_log = format;}
+
534  std::string format() const {return _format_log;}
+
535 
+
537  void format_comment(const std::string& format) {_format_dump = format;}
+
539  std::string format_comment() const {return _format_dump;}
540 
-
542  void threshold(level l) {_stage = l;}
-
544  void threshold(const std::string& l) {_stage = this->level_of(l);}
-
546  level threshold() const {return _stage;}
-
548  const std::map<std::string,level>& levels() const { return _word_level;}
-
549 
-
554  level level_of(const std::string name)
-
555  {
-
556  const auto ilevel = _word_level.find(name);
-
557  if( ilevel != std::end(_word_level)) {
-
558  return ilevel->second;
-
559  } else {
-
560  throw std::out_of_range("'" + name + "' is not a valid log level name");
-
561  }
-
562  }
-
563 
-
565  void file(std::string file) {_in_file = file;}
-
567  void func(std::string func) {_in_func = func;}
-
569  void line(std::string line) {_in_line = line;}
-
570 
-
572  void location(
-
573  const std::string& in_file,
-
574  const std::string& in_function=".*",
-
575  const std::string& in_line=".*"
-
576  )
-
577  {
-
578  file(in_file);
-
579  func(in_function);
-
580  line(in_line);
-
581  }
+
542  void out(std::ostream& out) {_out = &out;}
+
544  std::ostream& out() {return *_out;}
+
545 
+
546 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
547  void depth(size_t d) {_depth = d;}
+
550  size_t depth() const {return _depth;}
+
551 
+
553  void depth_mark(const std::string mark) {_depth_mark = mark;}
+
555  std::string depth_mark() const {return _depth_mark;}
+
556 
+
558  void strip_calls(const size_t n) {_strip_calls = n;}
+
560  size_t strip_calls() const {return _strip_calls;}
+
561 #endif
+
562 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL == 1
+
563  void hfill_mark(const char mark) {_hfill_char = mark;}
+
566  char hfill_mark() const {return _hfill_char;}
+
568  void hfill_style(fmt style) {_hfill_fmt = style;}
+
573  template<class ... FMT>
+
574  void style(FMT... styles) { this->hfill_style(fmt(styles...)); }
+
576  fmt hfill_style() const {return _hfill_fmt;}
+
578  void hfill_max(const size_t nmax) {_hfill_max = nmax;}
+
580  unsigned short hfill_max() {return _hfill_max;}
+
581 #endif
582 
-
587  template<class ... FMT>
-
588  void style(level stage, FMT... styles) { this->style(stage,fmt(styles...)); }
-
590  void style(level stage, fmt style) { _level_fmt.at(stage) = style; }
-
592  fmt style(level stage) const { return _level_fmt.at(stage); }
-
593 
-
596  public:
-
597 
-
601  struct scope_t {
-
604  bool matches;
- -
607 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
608 
-
609  size_t depth;
-
610 #endif
-
611 
-
612  bool there;
- -
615  matches(false),
-
616  stage(level::xdebug),
- -
618  depth(0),
-
619 #endif
-
620  there(false)
-
621  {}
-
622  }; // scope_t
-
623 
+
584  void threshold(level l) {_stage = l;}
+
586  void threshold(const std::string& l) {_stage = this->level_of(l);}
+
588  level threshold() const {return _stage;}
+
590  const std::map<std::string,level>& levels() const { return _word_level;}
+
591 
+
596  level level_of(const std::string name)
+
597  {
+
598  const auto ilevel = _word_level.find(name);
+
599  if( ilevel != std::end(_word_level)) {
+
600  return ilevel->second;
+
601  } else {
+
602  throw std::out_of_range("'" + name + "' is not a valid log level name");
+
603  }
+
604  }
+
605 
+
607  void file(std::string file) {_in_file = file;}
+
609  void func(std::string func) {_in_func = func;}
+
611  void line(std::string line) {_in_line = line;}
+
612 
+
614  void location(
+
615  const std::string& in_file,
+
616  const std::string& in_function=".*",
+
617  const std::string& in_line=".*"
+
618  )
+
619  {
+
620  file(in_file);
+
621  func(in_function);
+
622  line(in_line);
+
623  }
624 
- -
627  const level& stage,
-
628  const std::string& file,
-
629  const std::string& func,
-
630  const size_t line
-
631  ) const
-
632  {
-
633  scope_t scope; // False scope by default.
-
634 
-
635  /***** Log level stage *****/
-
636  // Test stage first, because it's fastest.
-
637  scope.stage = stage;
-
638  if(not (scope.stage <= _stage)) {
-
639  // Bypass useless computations if no match
-
640  // because of the stage.
-
641  return scope;
-
642  }
-
643 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
644  /***** Stack depth *****/
-
645  // Backtrace in second, quite fast.
-
646  size_t stack_depth;
-
647  void *buffer[_max_buffer];
-
648  stack_depth = backtrace(buffer, _max_buffer);
-
649  scope.depth = stack_depth;
-
650  if(not (scope.depth <= _depth + _strip_calls)) {
-
651  // Bypass if no match.
-
652  return scope;
-
653  }
-
654 #endif
-
655 
-
656  /***** Location *****/
-
657  // Location last, slowest.
-
658  std::ostringstream sline; sline << line;
-
659  scope.there =
-
660  std::regex_search(file, _in_file)
-
661  and std::regex_search(func, _in_func)
-
662  and std::regex_search(sline.str(), _in_line);
-
663 
-
664  // No need to retest stage and depth, which are true here.
-
665  scope.matches = scope.there;
+
629  template<class ... FMT>
+
630  void style(level stage, FMT... styles) { this->style(stage,fmt(styles...)); }
+
632  void style(level stage, fmt style) { _level_fmt.at(stage) = style; }
+
634  fmt style(level stage) const { return _level_fmt.at(stage); }
+
635 
+
638  public:
+
639 
+
643  struct scope_t {
+
646  bool matches;
+ +
649 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
650 
+
651  size_t depth;
+
652 #endif
+
653 
+
654  bool there;
+ +
657  matches(false),
+
658  stage(level::xdebug),
+ +
660  depth(0),
+
661 #endif
+
662  there(false)
+
663  {}
+
664  }; // scope_t
+
665 
666 
-
667  return scope;
-
668  } // locate
-
669 
-
677  std::string replace(
-
678  const std::string& form,
-
679  const std::string& mark,
-
680  const std::string& tag
-
681  ) const
-
682  {
-
683  // Useless debug code, unless something fancy would be done with name tags.
-
684  // std::regex re;
-
685  // try {
-
686  // re = std::regex(mark);
-
687  //
-
688  // } catch(const std::regex_error& e) {
-
689  // std::cerr << "ERROR with a regular expression \"" << mark << "\": ";
-
690  // switch(e.code()) {
-
691  // case std::regex_constants::error_collate:
-
692  // std::cerr << "the expression contains an invalid collating element name";
-
693  // break;
-
694  // case std::regex_constants::error_ctype:
-
695  // std::cerr << "the expression contains an invalid character class name";
-
696  // break;
-
697  // case std::regex_constants::error_escape:
-
698  // std::cerr << "the expression contains an invalid escaped character or a trailing escape";
-
699  // break;
-
700  // case std::regex_constants::error_backref:
-
701  // std::cerr << "the expression contains an invalid back reference";
-
702  // break;
-
703  // case std::regex_constants::error_brack:
-
704  // std::cerr << "the expression contains mismatched square brackets ('[' and ']')";
-
705  // break;
-
706  // case std::regex_constants::error_paren:
-
707  // std::cerr << "the expression contains mismatched parentheses ('(' and ')')";
-
708  // break;
-
709  // case std::regex_constants::error_brace:
-
710  // std::cerr << "the expression contains mismatched curly braces ('{' and '}')";
-
711  // break;
-
712  // case std::regex_constants::error_badbrace:
-
713  // std::cerr << "the expression contains an invalid range in a {} expression";
-
714  // break;
-
715  // case std::regex_constants::error_range:
-
716  // std::cerr << "the expression contains an invalid character range (e.g. [b-a])";
-
717  // break;
-
718  // case std::regex_constants::error_space:
-
719  // std::cerr << "there was not enough memory to convert the expression into a finite state machine";
-
720  // break;
-
721  // case std::regex_constants::error_badrepeat:
-
722  // std::cerr << "one of *?+{ was not preceded by a valid regular expression";
-
723  // break;
-
724  // case std::regex_constants::error_complexity:
-
725  // std::cerr << "the complexity of an attempted match exceeded a predefined level";
-
726  // break;
-
727  // case std::regex_constants::error_stack:
-
728  // std::cerr << "there was not enough memory to perform a match";
-
729  // break;
-
730  // default:
-
731  // std::cerr << "unknown error";
-
732  // }
-
733  // std::cerr << std::endl;
-
734  // throw;
-
735  // } // catch
-
736 
-
737  const std::regex re(mark);
-
738  return std::regex_replace(form, re, tag);
-
739  }
-
740 
-
742  std::string replace(
-
743  const std::string& form,
-
744  const std::string& mark,
-
745  const size_t tag
-
746  ) const
-
747  {
-
748  std::ostringstream stag; stag << tag;
-
749  return replace(form, mark, stag.str());
-
750  }
-
751 
-
753  std::string format(
-
754  std::string format,
-
755  const std::string& what,
- -
757  const std::string& name,
-
758 #endif
-
759  const level& stage,
-
760  const std::string& file,
-
761  const std::string& func,
-
762  const size_t line
- -
764  ,
-
765  const size_t depth
-
766 #endif
-
767  ) const
-
768  {
-
769  format = replace(format, "\\{msg\\}", what);
-
770  format = replace(format, "\\{file\\}", file);
-
771  format = replace(format, "\\{func\\}", func);
-
772  format = replace(format, "\\{line\\}", line);
-
773 
-
774  format = replace(format, "\\{level\\}", _level_word.at(stage));
-
775  std::string letter(1, _level_word.at(stage).at(0)); // char -> string
-
776  format = replace(format, "\\{level_letter\\}", letter);
-
777 
-
778 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
779  format = replace(format, "\\{name\\}", name);
-
780  format = replace(format, "\\{depth\\}", depth - _strip_calls);
-
781 
-
782  std::ostringstream chevrons;
-
783  for(size_t i = _strip_calls; i < depth; ++i) {
-
784  chevrons << _depth_mark;
-
785  }
-
786  format = replace(format, "\\{depth_marks\\}", chevrons.str());
-
787 #endif
-
788 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
-
789  const std::string hfill_tag = "{hfill}";
-
790  const size_t hfill_pos = format.find(hfill_tag);
-
791  if(hfill_pos != std::string::npos) {
-
792  if(_nb_columns > 0) {
-
793  const size_t left_len = hfill_pos;
-
794  const size_t right_len = format.size() - hfill_pos - hfill_tag.size();
-
795  if(right_len+left_len > _nb_columns) {
-
796  // The right part would go over the terminal width: add a new line.
-
797  const std::string hfill(std::max((size_t)0, _nb_columns-right_len), _hfill_char);
-
798  format = replace(format, "\\{hfill\\}", "\n"+hfill);
-
799  } else {
-
800  // There is some space in between left and right parts.
-
801  const std::string hfill(std::max((size_t)0, _nb_columns - (right_len+left_len)), _hfill_char);
-
802  format = replace(format, "\\{hfill\\}", hfill);
-
803  }
-
804  } else {
-
805  // We don't know the terminal width.
-
806  format = replace(format, "\\{hfill\\}", _hfill_char);
-
807  }
-
808  }
-
809 #endif
-
810  return _level_fmt.at(stage)(format);
-
811  }
-
812 
-
814  void log(
-
815  const level& stage,
-
816  const std::string& what,
-
817  const std::string& file, const std::string& func, size_t line
-
818  ) const
-
819  {
-
820  scope_t scope = locate(stage, file, func, line);
-
821 
-
822  if(scope.matches) {
-
823 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
824  *_out << format(_format_log, what, basename(getenv("_")),
-
825  stage, file, func,
-
826  line, scope.depth );
-
827 #else
-
828  *_out << format(_format_log, what,
-
829  stage, file, func,
-
830  line );
-
831 
-
832 #endif
-
833  _out->flush();
-
834  } // if scopes.matches
-
835  }
-
836 
-
838  template<class In>
-
839  void dump(
-
840  const level& stage,
-
841  const In container_begin, const In container_end,
-
842  const std::string& file, const std::string& func, size_t line,
-
843  const std::string& filename_template = "dump_{n}.dat",
-
844  const std::string sep = dump_default_sep
-
845  ) const
-
846  {
-
847  scope_t scope = locate(stage, file, func, line);
-
848 
-
849  if(scope.matches) {
-
850  const std::string tag = "\\{n\\}";
-
851  const std::regex re(tag);
-
852  std::string outfile = "";
-
853 
-
854  // If the file name template has the {n} tag.
-
855  if(std::regex_search(filename_template, re)) {
-
856  // Increment n until a free one is found.
-
857  size_t n = 0;
-
858  do {
-
859  outfile = replace(filename_template, tag, n);
-
860  n++;
-
861  } while( fs::exists( outfile ) );
-
862 
-
863  } else {
-
864  // Use the parameter as is.
-
865  outfile = filename_template;
-
866  }
+ +
669  const level& stage,
+
670  const std::string& file,
+
671  const std::string& func,
+
672  const size_t line
+
673  ) const
+
674  {
+
675  scope_t scope; // False scope by default.
+
676 
+
677  /***** Log level stage *****/
+
678  // Test stage first, because it's fastest.
+
679  scope.stage = stage;
+
680  if(not (scope.stage <= _stage)) {
+
681  // Bypass useless computations if no match
+
682  // because of the stage.
+
683  return scope;
+
684  }
+
685 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
686  /***** Stack depth *****/
+
687  // Backtrace in second, quite fast.
+
688  size_t stack_depth;
+
689  void *buffer[_max_buffer];
+
690  stack_depth = backtrace(buffer, _max_buffer);
+
691  scope.depth = stack_depth;
+
692  if(not (scope.depth <= _depth + _strip_calls)) {
+
693  // Bypass if no match.
+
694  return scope;
+
695  }
+
696 #endif
+
697 
+
698  /***** Location *****/
+
699  // Location last, slowest.
+
700  std::ostringstream sline; sline << line;
+
701  scope.there =
+
702  std::regex_search(file, _in_file)
+
703  and std::regex_search(func, _in_func)
+
704  and std::regex_search(sline.str(), _in_line);
+
705 
+
706  // No need to retest stage and depth, which are true here.
+
707  scope.matches = scope.there;
+
708 
+
709  return scope;
+
710  } // locate
+
711 
+
719  std::string replace(
+
720  const std::string& form,
+
721  const std::string& mark,
+
722  const std::string& tag
+
723  ) const
+
724  {
+
725  // Useless debug code, unless something fancy would be done with name tags.
+
726  // std::regex re;
+
727  // try {
+
728  // re = std::regex(mark);
+
729  //
+
730  // } catch(const std::regex_error& e) {
+
731  // std::cerr << "ERROR with a regular expression \"" << mark << "\": ";
+
732  // switch(e.code()) {
+
733  // case std::regex_constants::error_collate:
+
734  // std::cerr << "the expression contains an invalid collating element name";
+
735  // break;
+
736  // case std::regex_constants::error_ctype:
+
737  // std::cerr << "the expression contains an invalid character class name";
+
738  // break;
+
739  // case std::regex_constants::error_escape:
+
740  // std::cerr << "the expression contains an invalid escaped character or a trailing escape";
+
741  // break;
+
742  // case std::regex_constants::error_backref:
+
743  // std::cerr << "the expression contains an invalid back reference";
+
744  // break;
+
745  // case std::regex_constants::error_brack:
+
746  // std::cerr << "the expression contains mismatched square brackets ('[' and ']')";
+
747  // break;
+
748  // case std::regex_constants::error_paren:
+
749  // std::cerr << "the expression contains mismatched parentheses ('(' and ')')";
+
750  // break;
+
751  // case std::regex_constants::error_brace:
+
752  // std::cerr << "the expression contains mismatched curly braces ('{' and '}')";
+
753  // break;
+
754  // case std::regex_constants::error_badbrace:
+
755  // std::cerr << "the expression contains an invalid range in a {} expression";
+
756  // break;
+
757  // case std::regex_constants::error_range:
+
758  // std::cerr << "the expression contains an invalid character range (e.g. [b-a])";
+
759  // break;
+
760  // case std::regex_constants::error_space:
+
761  // std::cerr << "there was not enough memory to convert the expression into a finite state machine";
+
762  // break;
+
763  // case std::regex_constants::error_badrepeat:
+
764  // std::cerr << "one of *?+{ was not preceded by a valid regular expression";
+
765  // break;
+
766  // case std::regex_constants::error_complexity:
+
767  // std::cerr << "the complexity of an attempted match exceeded a predefined level";
+
768  // break;
+
769  // case std::regex_constants::error_stack:
+
770  // std::cerr << "there was not enough memory to perform a match";
+
771  // break;
+
772  // default:
+
773  // std::cerr << "unknown error";
+
774  // }
+
775  // std::cerr << std::endl;
+
776  // throw;
+
777  // } // catch
+
778 
+
779  const std::regex re(mark);
+
780  return std::regex_replace(form, re, tag);
+
781  }
+
782 
+
784  std::string replace(
+
785  const std::string& form,
+
786  const std::string& mark,
+
787  const size_t tag
+
788  ) const
+
789  {
+
790  std::ostringstream stag; stag << tag;
+
791  return replace(form, mark, stag.str());
+
792  }
+
793 
+
795  std::string format(
+
796  std::string format,
+
797  const std::string& what,
+ +
799  const std::string& name,
+
800 #endif
+
801  const level& stage,
+
802  const std::string& file,
+
803  const std::string& func,
+
804  const size_t line
+ +
806  ,
+
807  const size_t depth
+
808 #endif
+
809  ) const
+
810  {
+
811  format = replace(format, "\\{msg\\}", what);
+
812  format = replace(format, "\\{file\\}", file);
+
813  format = replace(format, "\\{func\\}", func);
+
814  format = replace(format, "\\{line\\}", line);
+
815 
+
816  format = replace(format, "\\{level\\}", _level_word.at(stage));
+
817  std::string letter(1, _level_word.at(stage).at(0)); // char -> string
+
818  format = replace(format, "\\{level_letter\\}", letter);
+
819 
+
820 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
821  format = replace(format, "\\{name\\}", name);
+
822  format = replace(format, "\\{depth\\}", depth - _strip_calls);
+
823 
+
824  std::ostringstream chevrons;
+
825  for(size_t i = _strip_calls; i < depth; ++i) {
+
826  chevrons << _depth_mark;
+
827  }
+
828  format = replace(format, "\\{depth_marks\\}", chevrons.str());
+
829 #endif
+
830 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL
+
831  const std::string hfill_tag = "{hfill}";
+
832  const size_t hfill_pos = format.find(hfill_tag);
+
833  if(hfill_pos != std::string::npos) {
+
834  if(_nb_columns > 0) {
+
835  const size_t left_len = hfill_pos;
+
836  const size_t right_len = format.size() - hfill_pos - hfill_tag.size();
+
837  if(right_len+left_len > _nb_columns) {
+
838  // The right part would go over the terminal width: add a new line.
+
839  const std::string hfill(std::max((size_t)0, _nb_columns-right_len), _hfill_char);
+
840  const std::string hfill_styled = _hfill_fmt(hfill);
+
841  format = replace(format, "\\{hfill\\}", "\n"+hfill_styled);
+
842  } else {
+
843  // There is some space in between left and right parts.
+
844  const std::string hfill(std::max((size_t)0, _nb_columns - (right_len+left_len)), _hfill_char);
+
845  const std::string hfill_styled = _hfill_fmt(hfill);
+
846  format = replace(format, "\\{hfill\\}", hfill_styled);
+
847  }
+
848  } else {
+
849  // We don't know the terminal width.
+
850  const std::string hfill(1, _hfill_char);
+
851  const std::string hfill_styled = _hfill_fmt(hfill);
+
852  format = replace(format, "\\{hfill\\}", hfill_styled);
+
853  }
+
854  }
+
855 #endif
+
856  return _level_fmt.at(stage)(format);
+
857  }
+
858 
+
860  void log(
+
861  const level& stage,
+
862  const std::string& what,
+
863  const std::string& file, const std::string& func, size_t line
+
864  ) const
+
865  {
+
866  scope_t scope = locate(stage, file, func, line);
867 
-
868  std::ofstream fd(outfile);
-
869 
-
870  if(_format_dump.size() > 0) {
-
871 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
872  fd << format(_format_dump, "", basename(getenv("_")),
-
873  stage, file, func,
-
874  line, scope.depth );
-
875 #else
-
876  fd << format(_format_dump, "",
-
877  stage, file, func,
-
878  line );
-
879 #endif
-
880  fd << sep; // sep after comment line.
-
881  }
+
868  if(scope.matches) {
+
869 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
870  *_out << format(_format_log, what, basename(getenv("_")),
+
871  stage, file, func,
+
872  line, scope.depth );
+
873 #else
+
874  *_out << format(_format_log, what,
+
875  stage, file, func,
+
876  line );
+
877 
+
878 #endif
+
879  _out->flush();
+
880  } // if scopes.matches
+
881  }
882 
-
883  std::copy(container_begin, container_end,
-
884  std::ostream_iterator<typename In::value_type>(fd, sep.c_str()));
-
885 
-
886  fd.close();
-
887  } // if scopes.matches
-
888  }
-
889 
-
891 };
-
892 
-
895 #else // not WITH_CLUTCHLOG
-
896 
-
897 
-
898 /**********************************************************************
-
899  * Fake implementation
-
900  **********************************************************************/
-
901 
-
902 // Equivalent class with empty methods, will be optimized out
-
903 // while allowing to actually have calls implemented without WITH_CLUTCHLOG guards.
-
904 #pragma GCC diagnostic push
-
905 #pragma GCC diagnostic ignored "-Wreturn-type"
-
906 class clutchlog
-
907 {
-
908  public:
-
909  static clutchlog& logger() {}
-
910  enum level {critical=0, error=1, warning=2, progress=3, note=4, info=5, debug=6, xdebug=7};
-
911  class fmt {
-
912  public:
-
913  enum class fg { black, red, green, yellow, blue, magenta, cyan, white, none } fore;
-
914  enum class bg { black, red, green, yellow, blue, magenta, cyan, white, none } back;
-
915  enum class typo { reset, bold, underline, inverse, none } style;
-
916  fmt() : fore(fg::none), back(bg::none), style(typo::none) {}
-
917  fmt( fg f, bg b = bg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
-
918  fmt( fg f, typo s , bg b = bg::none) : fore(f), back(b), style(s) {}
-
919  fmt( bg b, fg f = fg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
-
920  fmt( bg b, typo s , fg f = fg::none) : fore(f), back(b), style(s) {}
-
921  fmt(typo s, fg f = fg::none, bg b = bg::none) : fore(f), back(b), style(s) {}
-
922  fmt(typo s, bg b , fg f = fg::none) : fore(f), back(b), style(s) {}
-
923  protected:
-
924  std::ostream& print_on(std::ostream&) const {}
-
925  public:
-
926  friend std::ostream& operator<<(std::ostream&, const fmt&) {}
-
927  std::string operator()(const std::string&) const {}
-
928  };
-
929  public:
-
930  clutchlog(clutchlog const&) = delete;
-
931  void operator=(clutchlog const&) = delete;
-
932  private:
-
933  clutchlog() {}
-
934  protected:
-
935  struct scope_t {};
-
936  scope_t locate(
-
937  const level&,
-
938  const std::string&,
-
939  const std::string&,
-
940  const size_t
-
941  ) const
-
942  {}
-
943  public:
-
944  void format(const std::string&) {}
-
945  std::string format() const {}
-
946 
-
947  void format_comment(const std::string&) {}
-
948  std::string format_comment() const {}
-
949 
-
950  void out(std::ostream&) {}
-
951  std::ostream& out() {}
-
952 
-
953 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
-
954  void depth(size_t) {}
-
955  size_t depth() const {}
-
956 
-
957  void depth_mark(const std::string) {}
-
958  std::string depth_mark() const {}
-
959 #endif
-
960 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL == 1
-
961  void hfill_mark(const char) {}
-
962  char hfill_mark() const {}
-
963 #endif
-
964 
-
965  void threshold(level) {}
-
966  void threshold(const std::string&) {}
-
967  level threshold() const {}
-
968  const std::map<std::string,level> levels() const {};
-
969  level level_of(const std::string) {}
-
970 
-
971  void file(std::string) {}
-
972  void func(std::string) {}
-
973  void line(std::string) {}
-
974 
-
975 #pragma GCC diagnostic push
-
976 #pragma GCC diagnostic ignored "-Wunused-parameter"
-
977  void location(
-
978  const std::string&,
-
979  const std::string& in_function=".*",
-
980  const std::string& in_line=".*"
-
981  )
-
982  {}
-
983 #pragma GCC diagnostic pop
-
984  void style(level, fmt) {}
-
985  fmt style(level) const {}
-
986  public:
-
987  std::string replace(
-
988  const std::string&,
-
989  const std::string&,
-
990  const std::string&
-
991  ) const
-
992  {}
-
993 
-
994  std::string replace(
-
995  const std::string&,
-
996  const std::string&,
-
997  const size_t
-
998  ) const
-
999  {}
-
1000 
-
1001  std::string format(
-
1002  std::string,
-
1003  const std::string&,
- -
1005  const std::string&,
-
1006 #endif
-
1007  const level&,
-
1008  const std::string&,
-
1009  const std::string&,
-
1010  const size_t
- -
1012  ,
-
1013  const size_t
-
1014 #endif
-
1015  ) const
-
1016  {}
-
1017 
-
1018  void log(
-
1019  const level&,
-
1020  const std::string&,
-
1021  const std::string&, const std::string&, size_t
-
1022  ) const
-
1023  {}
-
1024 
-
1025  template<class In>
-
1026  void dump(
-
1027  const level&,
-
1028  const In, const In,
-
1029  const std::string&, const std::string&, size_t,
+
884  template<class In>
+
885  void dump(
+
886  const level& stage,
+
887  const In container_begin, const In container_end,
+
888  const std::string& file, const std::string& func, size_t line,
+
889  const std::string& filename_template = "dump_{n}.dat",
+
890  const std::string sep = dump_default_sep
+
891  ) const
+
892  {
+
893  scope_t scope = locate(stage, file, func, line);
+
894 
+
895  if(scope.matches) {
+
896  const std::string tag = "\\{n\\}";
+
897  const std::regex re(tag);
+
898  std::string outfile = "";
+
899 
+
900  // If the file name template has the {n} tag.
+
901  if(std::regex_search(filename_template, re)) {
+
902  // Increment n until a free one is found.
+
903  size_t n = 0;
+
904  do {
+
905  outfile = replace(filename_template, tag, n);
+
906  n++;
+
907  } while( fs::exists( outfile ) );
+
908 
+
909  } else {
+
910  // Use the parameter as is.
+
911  outfile = filename_template;
+
912  }
+
913 
+
914  std::ofstream fd(outfile);
+
915 
+
916  if(_format_dump.size() > 0) {
+
917 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
918  fd << format(_format_dump, "", basename(getenv("_")),
+
919  stage, file, func,
+
920  line, scope.depth );
+
921 #else
+
922  fd << format(_format_dump, "",
+
923  stage, file, func,
+
924  line );
+
925 #endif
+
926  fd << sep; // sep after comment line.
+
927  }
+
928 
+
929  std::copy(container_begin, container_end,
+
930  std::ostream_iterator<typename In::value_type>(fd, sep.c_str()));
+
931 
+
932  fd.close();
+
933  } // if scopes.matches
+
934  }
+
935 
+
937 };
+
938 
+
941 #else // not WITH_CLUTCHLOG
+
942 
+
943 
+
944 /**********************************************************************
+
945  * Fake implementation
+
946  **********************************************************************/
+
947 
+
948 // Equivalent class with empty methods, will be optimized out
+
949 // while allowing to actually have calls implemented without WITH_CLUTCHLOG guards.
+
950 #pragma GCC diagnostic push
+
951 #pragma GCC diagnostic ignored "-Wreturn-type"
+
952 class clutchlog
+
953 {
+
954  public:
+
955  static clutchlog& logger() {}
+
956  enum level {critical=0, error=1, warning=2, progress=3, note=4, info=5, debug=6, xdebug=7};
+
957  class fmt {
+
958  public:
+
959  enum class fg { black, red, green, yellow, blue, magenta, cyan, white, none } fore;
+
960  enum class bg { black, red, green, yellow, blue, magenta, cyan, white, none } back;
+
961  enum class typo { reset, bold, underline, inverse, none } style;
+
962  fmt() : fore(fg::none), back(bg::none), style(typo::none) {}
+
963  fmt( fg f, bg b = bg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
+
964  fmt( fg f, typo s , bg b = bg::none) : fore(f), back(b), style(s) {}
+
965  fmt( bg b, fg f = fg::none, typo s = typo::none) : fore(f), back(b), style(s) {}
+
966  fmt( bg b, typo s , fg f = fg::none) : fore(f), back(b), style(s) {}
+
967  fmt(typo s, fg f = fg::none, bg b = bg::none) : fore(f), back(b), style(s) {}
+
968  fmt(typo s, bg b , fg f = fg::none) : fore(f), back(b), style(s) {}
+
969  protected:
+
970  std::ostream& print_on(std::ostream&) const {}
+
971  public:
+
972  friend std::ostream& operator<<(std::ostream&, const fmt&) {}
+
973  std::string operator()(const std::string&) const {}
+
974  };
+
975  public:
+
976  clutchlog(clutchlog const&) = delete;
+
977  void operator=(clutchlog const&) = delete;
+
978  private:
+
979  clutchlog() {}
+
980  protected:
+
981  struct scope_t {};
+
982  scope_t locate(
+
983  const level&,
+
984  const std::string&,
+
985  const std::string&,
+
986  const size_t
+
987  ) const
+
988  {}
+
989  public:
+
990  void format(const std::string&) {}
+
991  std::string format() const {}
+
992 
+
993  void format_comment(const std::string&) {}
+
994  std::string format_comment() const {}
+
995 
+
996  void out(std::ostream&) {}
+
997  std::ostream& out() {}
+
998 
+
999 #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
+
1000  void depth(size_t) {}
+
1001  size_t depth() const {}
+
1002 
+
1003  void depth_mark(const std::string) {}
+
1004  std::string depth_mark() const {}
+
1005  void strip_calls(const size_t) {}
+
1006  size_t strip_calls() const {}
+
1007 #endif
+
1008 #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL == 1
+
1009  void hfill_mark(const char) {}
+
1010  char hfill_mark() const {}
+
1011  void hfill_fmt(fmt) {}
+
1012  fmt hfill_fmt() const {}
+
1013  void hfill_max(const size_t) {}
+
1014  unsigned short hfill_max() {}
+
1015 #endif
+
1016 
+
1017  void threshold(level) {}
+
1018  void threshold(const std::string&) {}
+
1019  level threshold() const {}
+
1020  const std::map<std::string,level> levels() const {}
+
1021  level level_of(const std::string) {}
+
1022 
+
1023  void file(std::string) {}
+
1024  void func(std::string) {}
+
1025  void line(std::string) {}
+
1026 
+
1027 #pragma GCC diagnostic push
+
1028 #pragma GCC diagnostic ignored "-Wunused-parameter"
+
1029  void location(
1030  const std::string&,
-
1031  const std::string
-
1032  ) const
-
1033  {}
-
1034 };
+
1031  const std::string& in_function=".*",
+
1032  const std::string& in_line=".*"
+
1033  )
+
1034  {}
1035 #pragma GCC diagnostic pop
-
1036 #endif // WITH_CLUTCHLOG
-
1037 
-
1038 #endif // __CLUTCHLOG_H__
+
1036  template<class ... FMT>
+
1037  void style(level, FMT...) {}
+
1038  void style(level, fmt) {}
+
1039  fmt style(level) const {}
+
1040  public:
+
1041  std::string replace(
+
1042  const std::string&,
+
1043  const std::string&,
+
1044  const std::string&
+
1045  ) const
+
1046  {}
+
1047 
+
1048  std::string replace(
+
1049  const std::string&,
+
1050  const std::string&,
+
1051  const size_t
+
1052  ) const
+
1053  {}
+
1054 
+
1055  std::string format(
+
1056  std::string,
+
1057  const std::string&,
+ +
1059  const std::string&,
+
1060 #endif
+
1061  const level&,
+
1062  const std::string&,
+
1063  const std::string&,
+
1064  const size_t
+ +
1066  ,
+
1067  const size_t
+
1068 #endif
+
1069  ) const
+
1070  {}
+
1071 
+
1072  void log(
+
1073  const level&,
+
1074  const std::string&,
+
1075  const std::string&, const std::string&, size_t
+
1076  ) const
+
1077  {}
+
1078 
+
1079  template<class In>
+
1080  void dump(
+
1081  const level&,
+
1082  const In, const In,
+
1083  const std::string&, const std::string&, size_t,
+
1084  const std::string&,
+
1085  const std::string
+
1086  ) const
+
1087  {}
+
1088 };
+
1089 #pragma GCC diagnostic pop
+
1090 #endif // WITH_CLUTCHLOG
+
1091 
+
1092 #endif // CLUTCHLOG_H
-
void file(std::string file)
Set the regular expression filtering the file location.
Definition: clutchlog.h:565
+
void file(std::string file)
Set the regular expression filtering the file location.
Definition: clutchlog.h:607
#define CLUTCHDUMP_DEFAULT_FORMAT
Compile-time default format of the comment line in file dump.
Definition: clutchlog.h:217
-
fg
Foreground color codes.
Definition: clutchlog.h:297
+
fg
Foreground color codes.
Definition: clutchlog.h:310
static std::string dump_default_format
Default format of the comment line in file dump.
Definition: clutchlog.h:231
-
const std::map< std::string, level > & levels() const
Get the map of available log levels string representations toward their identifier....
Definition: clutchlog.h:548
-
void out(std::ostream &out)
Set the output stream on which to print.
Definition: clutchlog.h:519
-
fmt()
&#160;Empty constructor, only useful for a no-op formatter.
Definition: clutchlog.h:332
-
static clutchlog & logger()
Get the logger instance.
Definition: clutchlog.h:273
-
void line(std::string line)
Set the regular expression filtering the line location.
Definition: clutchlog.h:569
-
void format_comment(const std::string &format)
Set the template string for dumps.
Definition: clutchlog.h:514
-
typo
Typographic style codes.
Definition: clutchlog.h:323
+
const std::map< std::string, level > & levels() const
Get the map of available log levels string representations toward their identifier....
Definition: clutchlog.h:590
+
void out(std::ostream &out)
Set the output stream on which to print.
Definition: clutchlog.h:542
+
fmt()
&#160;Empty constructor, only useful for a no-op formatter.
Definition: clutchlog.h:345
+
static clutchlog & logger()
Get the logger instance.
Definition: clutchlog.h:286
+
void line(std::string line)
Set the regular expression filtering the line location.
Definition: clutchlog.h:611
+
void format_comment(const std::string &format)
Set the template string for dumps.
Definition: clutchlog.h:537
+
typo
Typographic style codes.
Definition: clutchlog.h:336
#define CLUTCHDUMP_DEFAULT_SEP
Compile-time default item separator for dump.
Definition: clutchlog.h:235
#define CLUTCHLOG_HFILL_MARK
Character used as a filling for right-align the right part of messages with "{hfill}".
Definition: clutchlog.h:256
static std::string default_depth_mark
Default mark for stack depth.
Definition: clutchlog.h:245
#define CLUTCHLOG_DEFAULT_FORMAT
Compile-time default format of the messages (debug mode: with absolute location).
Definition: clutchlog.h:194
-
std::string format() const
Get the template string.
Definition: clutchlog.h:511
-
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:814
-
level level_of(const std::string name)
Return the log level tag corresponding to the given pre-configured name.
Definition: clutchlog.h:554
-
std::string _format_dump
Current format of the file output.
Definition: clutchlog.h:472
-
std::string operator()(const std::string &msg) const
Format the given string with the currently encoded format.
Definition: clutchlog.h:391
-
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 corre...
Definition: clutchlog.h:753
-
std::string _format_log
Current format of the standard output.
Definition: clutchlog.h:470
-
level
Available log levels.
Definition: clutchlog.h:280
-
level stage
Current log level.
Definition: clutchlog.h:606
+
std::string format() const
Get the template string.
Definition: clutchlog.h:534
+
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:860
+
level level_of(const std::string name)
Return the log level tag corresponding to the given pre-configured name.
Definition: clutchlog.h:596
+
static unsigned short default_hfill_max
Default maximum number of character used as a filling for right-align the right part of messages with...
Definition: clutchlog.h:268
+
std::string _format_dump
Current format of the file output.
Definition: clutchlog.h:489
+
std::string operator()(const std::string &msg) const
Format the given string with the currently encoded format.
Definition: clutchlog.h:404
+
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 corre...
Definition: clutchlog.h:795
+
std::string _format_log
Current format of the standard output.
Definition: clutchlog.h:487
+
level
Available log levels.
Definition: clutchlog.h:293
+
level stage
Current log level.
Definition: clutchlog.h:648
#define CLUTCHLOG_DEFAULT_DEPTH_MARK
Compile-time default mark for stack depth.
Definition: clutchlog.h:242
-
friend std::ostream & operator<<(std::ostream &os, const fmt &fmt)
Output stream overload.
Definition: clutchlog.h:376
-
std::map< level, fmt > _level_fmt
Dictionary of level identifier to their format.
Definition: clutchlog.h:468
-
std::regex _in_line
Current line location filter.
Definition: clutchlog.h:490
+
friend std::ostream & operator<<(std::ostream &os, const fmt &fmt)
Output stream overload.
Definition: clutchlog.h:389
+
std::map< level, fmt > _level_fmt
Dictionary of level identifier to their format.
Definition: clutchlog.h:485
+
std::regex _in_line
Current line location filter.
Definition: clutchlog.h:513
enum clutchlog::fmt::typo style
Typographic style.
-
level _stage
Current log level.
Definition: clutchlog.h:484
-
const size_t _strip_calls
Current number of call stack levels to remove from depth display.
Definition: clutchlog.h:462
-
std::string format_comment() const
Get the template string for dumps.
Definition: clutchlog.h:516
+
level _stage
Current log level.
Definition: clutchlog.h:507
+
std::string format_comment() const
Get the template string for dumps.
Definition: clutchlog.h:539
+
size_t _strip_calls
Current number of call stack levels to remove from depth display.
Definition: clutchlog.h:479
#define CLUTCHLOG_STRIP_CALLS
Compile-time number of call stack levels to remove from depth display by default.
Definition: clutchlog.h:249
-
std::ostream * _out
Standard output.
Definition: clutchlog.h:476
-
void func(std::string func)
Set the regular expression filtering the function location.
Definition: clutchlog.h:567
-
void location(const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*")
Set the regular expressions filtering the location.
Definition: clutchlog.h:572
+
std::ostream * _out
Standard output.
Definition: clutchlog.h:499
+
void func(std::string func)
Set the regular expression filtering the function location.
Definition: clutchlog.h:609
+
void location(const std::string &in_file, const std::string &in_function=".*", const std::string &in_line=".*")
Set the regular expressions filtering the location.
Definition: clutchlog.h:614
static char default_hfill_char
Default character used as a filling for right-align the right part of messages with "{hfill}".
Definition: clutchlog.h:259
-
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.
Definition: clutchlog.h:839
-
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.
Definition: clutchlog.h:742
-
Color and style formatter for ANSI terminal escape sequences.
Definition: clutchlog.h:294
-
std::regex _in_file
Current file location filter.
Definition: clutchlog.h:486
-
std::ostream & out()
Get the output stream on which to print.
Definition: clutchlog.h:521
-
std::string replace(const std::string &form, const std::string &mark, const std::string &tag) const
Replace mark by tag in form.
Definition: clutchlog.h:677
+
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.
Definition: clutchlog.h:885
+
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.
Definition: clutchlog.h:784
+
Color and style formatter for ANSI terminal escape sequences.
Definition: clutchlog.h:307
+
std::regex _in_file
Current file location filter.
Definition: clutchlog.h:509
+
std::ostream & out()
Get the output stream on which to print.
Definition: clutchlog.h:544
+
std::string replace(const std::string &form, const std::string &mark, const std::string &tag) const
Replace mark by tag in form.
Definition: clutchlog.h:719
static unsigned int default_strip_calls
Number of call stack levels to remove from depth display by default.
Definition: clutchlog.h:252
-
char _hfill_char
Character for filling.
Definition: clutchlog.h:474
static std::string default_format
Default format of the messages.
Definition: clutchlog.h:209
enum clutchlog::fmt::fg fore
Foreground color.
-
void threshold(const std::string &l)
Set the log level (below which logs are not printed) with a string.
Definition: clutchlog.h:544
-
bool there
Location is compatible.
Definition: clutchlog.h:612
-
Structure holding a location matching.
Definition: clutchlog.h:602
-
std::regex _in_func
Current function location filter.
Definition: clutchlog.h:488
-
void threshold(level l)
Set the log level (below which logs are not printed) with an identifier.
Definition: clutchlog.h:542
-
void style(level stage, fmt style)
Set the style (color and typo) of the given log level, passing a fmt instance.
Definition: clutchlog.h:590
-
const std::map< level, std::string > _level_word
Dictionary of level identifier to their string representation.
Definition: clutchlog.h:464
-
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.
Definition: clutchlog.h:626
-
bool matches
Everything is compatible.
Definition: clutchlog.h:604
+
void threshold(const std::string &l)
Set the log level (below which logs are not printed) with a string.
Definition: clutchlog.h:586
+
bool there
Location is compatible.
Definition: clutchlog.h:654
+
Structure holding a location matching.
Definition: clutchlog.h:644
+
std::regex _in_func
Current function location filter.
Definition: clutchlog.h:511
+
void threshold(level l)
Set the log level (below which logs are not printed) with an identifier.
Definition: clutchlog.h:584
+
void style(level stage, fmt style)
Set the style (color and typo) of the given log level, passing a fmt instance.
Definition: clutchlog.h:632
+
const std::map< level, std::string > _level_word
Dictionary of level identifier to their string representation.
Definition: clutchlog.h:481
+
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.
Definition: clutchlog.h:668
+
bool matches
Everything is compatible.
Definition: clutchlog.h:646
static std::string dump_default_sep
Default item separator for dump.
Definition: clutchlog.h:238
-
level threshold() const
Get the log level below which logs are not printed.
Definition: clutchlog.h:546
-
std::ostream & print_on(std::ostream &os) const
Print the currently encoded format escape code on the given output stream.
Definition: clutchlog.h:346
-
std::map< std::string, level > _word_level
Dictionary of level string to their identifier.
Definition: clutchlog.h:466
-
void style(level stage, FMT... styles)
Set the style (color and typo) of the given log level.
Definition: clutchlog.h:588
-
scope_t()
Constructor.
Definition: clutchlog.h:614
+
level threshold() const
Get the log level below which logs are not printed.
Definition: clutchlog.h:588
+
std::ostream & print_on(std::ostream &os) const
Print the currently encoded format escape code on the given output stream.
Definition: clutchlog.h:359
+
std::map< std::string, level > _word_level
Dictionary of level string to their identifier.
Definition: clutchlog.h:483
+
void style(level stage, FMT... styles)
Set the style (color and typo) of the given log level.
Definition: clutchlog.h:630
+
scope_t()
Constructor.
Definition: clutchlog.h:656
#define CLUTCHLOG_HAVE_UNIX_SYSINFO
POSIX headers necessary for stack depth management are available.
Definition: clutchlog.h:32
Definition: clutchlog.h:175
-
fmt style(level stage) const
Get the configured fmt instance of the given log level.
Definition: clutchlog.h:592
-
bg
Background color codes.
Definition: clutchlog.h:310
+
fmt style(level stage) const
Get the configured fmt instance of the given log level.
Definition: clutchlog.h:634
+
bg
Background color codes.
Definition: clutchlog.h:323
enum clutchlog::fmt::bg back
Background color.
diff --git a/docs/dir_0597ce40fdf188e7870807c32590691d.html b/docs/dir_0597ce40fdf188e7870807c32590691d.html index 1f6df88..df0a096 100644 --- a/docs/dir_0597ce40fdf188e7870807c32590691d.html +++ b/docs/dir_0597ce40fdf188e7870807c32590691d.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_084dfc9a5a5be3c9e27543ac1f550db2.html b/docs/dir_084dfc9a5a5be3c9e27543ac1f550db2.html index e25f5a4..85f83c9 100644 --- a/docs/dir_084dfc9a5a5be3c9e27543ac1f550db2.html +++ b/docs/dir_084dfc9a5a5be3c9e27543ac1f550db2.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_0c6859326e57c84153d9ce3980c7b614.html b/docs/dir_0c6859326e57c84153d9ce3980c7b614.html index e4f9e05..f66a7b1 100644 --- a/docs/dir_0c6859326e57c84153d9ce3980c7b614.html +++ b/docs/dir_0c6859326e57c84153d9ce3980c7b614.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_10ddb028b6670bd8aa01364e6cad76a9.html b/docs/dir_10ddb028b6670bd8aa01364e6cad76a9.html index 074f033..3ff829d 100644 --- a/docs/dir_10ddb028b6670bd8aa01364e6cad76a9.html +++ b/docs/dir_10ddb028b6670bd8aa01364e6cad76a9.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_10e5b046fa80f4154fb6ef98b74319ee.html b/docs/dir_10e5b046fa80f4154fb6ef98b74319ee.html index c72c74a..4b62ed6 100644 --- a/docs/dir_10e5b046fa80f4154fb6ef98b74319ee.html +++ b/docs/dir_10e5b046fa80f4154fb6ef98b74319ee.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_11d96b0893f97b142d6effd564752a90.html b/docs/dir_11d96b0893f97b142d6effd564752a90.html index ddb1ae8..ba88f8d 100644 --- a/docs/dir_11d96b0893f97b142d6effd564752a90.html +++ b/docs/dir_11d96b0893f97b142d6effd564752a90.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_13368ad9184bbad1002e036a402da7c4.html b/docs/dir_13368ad9184bbad1002e036a402da7c4.html index e7af9cd..c5b88c3 100644 --- a/docs/dir_13368ad9184bbad1002e036a402da7c4.html +++ b/docs/dir_13368ad9184bbad1002e036a402da7c4.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_14f0b626af56b1ff4afcbb0dad5c9b00.html b/docs/dir_14f0b626af56b1ff4afcbb0dad5c9b00.html index 21e8f23..c22083c 100644 --- a/docs/dir_14f0b626af56b1ff4afcbb0dad5c9b00.html +++ b/docs/dir_14f0b626af56b1ff4afcbb0dad5c9b00.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_178d547a078d4731b3af021ed5ed0bd5.html b/docs/dir_178d547a078d4731b3af021ed5ed0bd5.html index 914a1ae..49d8f37 100644 --- a/docs/dir_178d547a078d4731b3af021ed5ed0bd5.html +++ b/docs/dir_178d547a078d4731b3af021ed5ed0bd5.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_183919ee65eb1ce3e4c28765d02d1592.html b/docs/dir_183919ee65eb1ce3e4c28765d02d1592.html index f5bb2b5..bbbba22 100644 --- a/docs/dir_183919ee65eb1ce3e4c28765d02d1592.html +++ b/docs/dir_183919ee65eb1ce3e4c28765d02d1592.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_2010fee6dc55af84ec3880814fe9859d.html b/docs/dir_2010fee6dc55af84ec3880814fe9859d.html index 295f243..11b52f7 100644 --- a/docs/dir_2010fee6dc55af84ec3880814fe9859d.html +++ b/docs/dir_2010fee6dc55af84ec3880814fe9859d.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_232d0e660737fa098457ae695f029c6e.html b/docs/dir_232d0e660737fa098457ae695f029c6e.html index e910fae..232bdc7 100644 --- a/docs/dir_232d0e660737fa098457ae695f029c6e.html +++ b/docs/dir_232d0e660737fa098457ae695f029c6e.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_27117ea8c3a88700c8b1db11c9562238.html b/docs/dir_27117ea8c3a88700c8b1db11c9562238.html index 878367d..2e0201c 100644 --- a/docs/dir_27117ea8c3a88700c8b1db11c9562238.html +++ b/docs/dir_27117ea8c3a88700c8b1db11c9562238.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_2c58f47b9ec63c233e9a6dc44b0220ce.html b/docs/dir_2c58f47b9ec63c233e9a6dc44b0220ce.html index 27792fa..f005156 100644 --- a/docs/dir_2c58f47b9ec63c233e9a6dc44b0220ce.html +++ b/docs/dir_2c58f47b9ec63c233e9a6dc44b0220ce.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3353b0403823e43b133a3a97f7b61528.html b/docs/dir_3353b0403823e43b133a3a97f7b61528.html index e035193..326052c 100644 --- a/docs/dir_3353b0403823e43b133a3a97f7b61528.html +++ b/docs/dir_3353b0403823e43b133a3a97f7b61528.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3354f823b93c486985d8eff812f202d0.html b/docs/dir_3354f823b93c486985d8eff812f202d0.html index a0c9c57..843cdcd 100644 --- a/docs/dir_3354f823b93c486985d8eff812f202d0.html +++ b/docs/dir_3354f823b93c486985d8eff812f202d0.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3580e889fffd597e9f1e74f0989be3f4.html b/docs/dir_3580e889fffd597e9f1e74f0989be3f4.html index fe56b0b..6dc7072 100644 --- a/docs/dir_3580e889fffd597e9f1e74f0989be3f4.html +++ b/docs/dir_3580e889fffd597e9f1e74f0989be3f4.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_38468fa15d001d8f53eb5a2cc819fc4d.html b/docs/dir_38468fa15d001d8f53eb5a2cc819fc4d.html index 8abe2af..661d71b 100644 --- a/docs/dir_38468fa15d001d8f53eb5a2cc819fc4d.html +++ b/docs/dir_38468fa15d001d8f53eb5a2cc819fc4d.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3b27b7a7434122ddfe41170c43d31183.html b/docs/dir_3b27b7a7434122ddfe41170c43d31183.html index 5cb031b..d3f6a58 100644 --- a/docs/dir_3b27b7a7434122ddfe41170c43d31183.html +++ b/docs/dir_3b27b7a7434122ddfe41170c43d31183.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3b3b5af829689cf9fc261f0e6a0edda6.html b/docs/dir_3b3b5af829689cf9fc261f0e6a0edda6.html index c50138c..dd353cf 100644 --- a/docs/dir_3b3b5af829689cf9fc261f0e6a0edda6.html +++ b/docs/dir_3b3b5af829689cf9fc261f0e6a0edda6.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3e1bb72ed66f215303e7248107b2c843.html b/docs/dir_3e1bb72ed66f215303e7248107b2c843.html index 62994a4..23f8155 100644 --- a/docs/dir_3e1bb72ed66f215303e7248107b2c843.html +++ b/docs/dir_3e1bb72ed66f215303e7248107b2c843.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_3e4d9bbf23e4011a0d79c59ef1fbe4fa.html b/docs/dir_3e4d9bbf23e4011a0d79c59ef1fbe4fa.html index f70da7e..9db4b07 100644 --- a/docs/dir_3e4d9bbf23e4011a0d79c59ef1fbe4fa.html +++ b/docs/dir_3e4d9bbf23e4011a0d79c59ef1fbe4fa.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_44d46ce0fefad9fb4568613342a0f089.html b/docs/dir_44d46ce0fefad9fb4568613342a0f089.html index 360591e..d2e79c4 100644 --- a/docs/dir_44d46ce0fefad9fb4568613342a0f089.html +++ b/docs/dir_44d46ce0fefad9fb4568613342a0f089.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_49bf50162b43c6eb0e5d51c9a154dd85.html b/docs/dir_49bf50162b43c6eb0e5d51c9a154dd85.html index 8488c51..05eb44e 100644 --- a/docs/dir_49bf50162b43c6eb0e5d51c9a154dd85.html +++ b/docs/dir_49bf50162b43c6eb0e5d51c9a154dd85.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_56412180890141897a46e337654f67d2.html b/docs/dir_56412180890141897a46e337654f67d2.html index 359752a..05b0129 100644 --- a/docs/dir_56412180890141897a46e337654f67d2.html +++ b/docs/dir_56412180890141897a46e337654f67d2.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_56a467a6a3c52bfafa193ec205c1fdda.html b/docs/dir_56a467a6a3c52bfafa193ec205c1fdda.html index bd9a221..4b0a33f 100644 --- a/docs/dir_56a467a6a3c52bfafa193ec205c1fdda.html +++ b/docs/dir_56a467a6a3c52bfafa193ec205c1fdda.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_581e3e812319f368929566c0af58ce01.html b/docs/dir_581e3e812319f368929566c0af58ce01.html index 4610434..9925ffa 100644 --- a/docs/dir_581e3e812319f368929566c0af58ce01.html +++ b/docs/dir_581e3e812319f368929566c0af58ce01.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_59425e443f801f1f2fd8bbe4959a3ccf.html b/docs/dir_59425e443f801f1f2fd8bbe4959a3ccf.html index e9296f0..8a7515e 100644 --- a/docs/dir_59425e443f801f1f2fd8bbe4959a3ccf.html +++ b/docs/dir_59425e443f801f1f2fd8bbe4959a3ccf.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_5b4d8a0ca6574b7df09df571ad9e67b6.html b/docs/dir_5b4d8a0ca6574b7df09df571ad9e67b6.html index a868039..14cb5dc 100644 --- a/docs/dir_5b4d8a0ca6574b7df09df571ad9e67b6.html +++ b/docs/dir_5b4d8a0ca6574b7df09df571ad9e67b6.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_61ab004aa8225a3da30151b57198e21f.html b/docs/dir_61ab004aa8225a3da30151b57198e21f.html index 4fd90b6..1f42c16 100644 --- a/docs/dir_61ab004aa8225a3da30151b57198e21f.html +++ b/docs/dir_61ab004aa8225a3da30151b57198e21f.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_758abd5d6f4fa812820adbe21fc77736.html b/docs/dir_758abd5d6f4fa812820adbe21fc77736.html index e7ea01c..da167dd 100644 --- a/docs/dir_758abd5d6f4fa812820adbe21fc77736.html +++ b/docs/dir_758abd5d6f4fa812820adbe21fc77736.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_7993767c315ca7e2492c0e12f2140894.html b/docs/dir_7993767c315ca7e2492c0e12f2140894.html index fef806f..7775463 100644 --- a/docs/dir_7993767c315ca7e2492c0e12f2140894.html +++ b/docs/dir_7993767c315ca7e2492c0e12f2140894.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_7ac2ccaca1f97cd5484903d036e6e018.html b/docs/dir_7ac2ccaca1f97cd5484903d036e6e018.html index a0d6378..c9d4442 100644 --- a/docs/dir_7ac2ccaca1f97cd5484903d036e6e018.html +++ b/docs/dir_7ac2ccaca1f97cd5484903d036e6e018.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_7bfd87e22fd8913a7cdac6885aea0fda.html b/docs/dir_7bfd87e22fd8913a7cdac6885aea0fda.html index 2db5516..8182d34 100644 --- a/docs/dir_7bfd87e22fd8913a7cdac6885aea0fda.html +++ b/docs/dir_7bfd87e22fd8913a7cdac6885aea0fda.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_7cb602820ef60ce7eb9af6d9eb8de17a.html b/docs/dir_7cb602820ef60ce7eb9af6d9eb8de17a.html index 06c159b..7af356b 100644 --- a/docs/dir_7cb602820ef60ce7eb9af6d9eb8de17a.html +++ b/docs/dir_7cb602820ef60ce7eb9af6d9eb8de17a.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_818a2d2dcebf5fa9f09b2ff370a5de12.html b/docs/dir_818a2d2dcebf5fa9f09b2ff370a5de12.html index 0c57134..55551a7 100644 --- a/docs/dir_818a2d2dcebf5fa9f09b2ff370a5de12.html +++ b/docs/dir_818a2d2dcebf5fa9f09b2ff370a5de12.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_8497d690b57aba136d1839e5c427d666.html b/docs/dir_8497d690b57aba136d1839e5c427d666.html index 2758b20..243fcfd 100644 --- a/docs/dir_8497d690b57aba136d1839e5c427d666.html +++ b/docs/dir_8497d690b57aba136d1839e5c427d666.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_894f8a189fd86151cf73b234a425a3d7.html b/docs/dir_894f8a189fd86151cf73b234a425a3d7.html index 81f1f56..3dc538c 100644 --- a/docs/dir_894f8a189fd86151cf73b234a425a3d7.html +++ b/docs/dir_894f8a189fd86151cf73b234a425a3d7.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_8a6224de47695006c09a16d36b73e641.html b/docs/dir_8a6224de47695006c09a16d36b73e641.html index b81c967..77d354e 100644 --- a/docs/dir_8a6224de47695006c09a16d36b73e641.html +++ b/docs/dir_8a6224de47695006c09a16d36b73e641.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_8c3cbcfef903547985c71f28526a37d7.html b/docs/dir_8c3cbcfef903547985c71f28526a37d7.html index 056b433..75231bd 100644 --- a/docs/dir_8c3cbcfef903547985c71f28526a37d7.html +++ b/docs/dir_8c3cbcfef903547985c71f28526a37d7.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_99be30a3dc5b3fd221ff5ea6bdbc52f4.html b/docs/dir_99be30a3dc5b3fd221ff5ea6bdbc52f4.html index 1009e2a..d917349 100644 --- a/docs/dir_99be30a3dc5b3fd221ff5ea6bdbc52f4.html +++ b/docs/dir_99be30a3dc5b3fd221ff5ea6bdbc52f4.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_99f269110bdc8201794420d5043dadef.html b/docs/dir_99f269110bdc8201794420d5043dadef.html index 512f2d3..a0f2211 100644 --- a/docs/dir_99f269110bdc8201794420d5043dadef.html +++ b/docs/dir_99f269110bdc8201794420d5043dadef.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_9a935cfcf36ab9c047ca734a48c6ea47.html b/docs/dir_9a935cfcf36ab9c047ca734a48c6ea47.html index f550b6f..d8eb1c2 100644 --- a/docs/dir_9a935cfcf36ab9c047ca734a48c6ea47.html +++ b/docs/dir_9a935cfcf36ab9c047ca734a48c6ea47.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_a5e190e82988878b02be1ad8893fe33a.html b/docs/dir_a5e190e82988878b02be1ad8893fe33a.html index 4318107..fa9a8ea 100644 --- a/docs/dir_a5e190e82988878b02be1ad8893fe33a.html +++ b/docs/dir_a5e190e82988878b02be1ad8893fe33a.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_a6147547081efd8e9250c1acee302c56.html b/docs/dir_a6147547081efd8e9250c1acee302c56.html index 0f8b0ca..3286567 100644 --- a/docs/dir_a6147547081efd8e9250c1acee302c56.html +++ b/docs/dir_a6147547081efd8e9250c1acee302c56.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_a808995e8af62dcd5e402dfccd15597d.html b/docs/dir_a808995e8af62dcd5e402dfccd15597d.html index 446b8d2..2346918 100644 --- a/docs/dir_a808995e8af62dcd5e402dfccd15597d.html +++ b/docs/dir_a808995e8af62dcd5e402dfccd15597d.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_a943a781f3047d1fe445d5e8eba50028.html b/docs/dir_a943a781f3047d1fe445d5e8eba50028.html index a43fbb6..f698e6a 100644 --- a/docs/dir_a943a781f3047d1fe445d5e8eba50028.html +++ b/docs/dir_a943a781f3047d1fe445d5e8eba50028.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_b1c763aea5b862e235cc9501e2ce06da.html b/docs/dir_b1c763aea5b862e235cc9501e2ce06da.html index 7f09e83..3af5f69 100644 --- a/docs/dir_b1c763aea5b862e235cc9501e2ce06da.html +++ b/docs/dir_b1c763aea5b862e235cc9501e2ce06da.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_b2c0fc6d3625db437ca13cb01c2a2d25.html b/docs/dir_b2c0fc6d3625db437ca13cb01c2a2d25.html index 8966447..85d5044 100644 --- a/docs/dir_b2c0fc6d3625db437ca13cb01c2a2d25.html +++ b/docs/dir_b2c0fc6d3625db437ca13cb01c2a2d25.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_be65af4ad555fa38f52fdec43511df23.html b/docs/dir_be65af4ad555fa38f52fdec43511df23.html index 2a4dfbd..d4c88b5 100644 --- a/docs/dir_be65af4ad555fa38f52fdec43511df23.html +++ b/docs/dir_be65af4ad555fa38f52fdec43511df23.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_bf56be71754e1b48f8f3e417eb89bb69.html b/docs/dir_bf56be71754e1b48f8f3e417eb89bb69.html index 98fb79d..a8af7ed 100644 --- a/docs/dir_bf56be71754e1b48f8f3e417eb89bb69.html +++ b/docs/dir_bf56be71754e1b48f8f3e417eb89bb69.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_c318bd5cf14aaa5601e6029e0b5b4048.html b/docs/dir_c318bd5cf14aaa5601e6029e0b5b4048.html index bf25249..68420f6 100644 --- a/docs/dir_c318bd5cf14aaa5601e6029e0b5b4048.html +++ b/docs/dir_c318bd5cf14aaa5601e6029e0b5b4048.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_c6d9c1238235b0a4853a9dfbf2961dcc.html b/docs/dir_c6d9c1238235b0a4853a9dfbf2961dcc.html index 9bf9fc6..0eb1269 100644 --- a/docs/dir_c6d9c1238235b0a4853a9dfbf2961dcc.html +++ b/docs/dir_c6d9c1238235b0a4853a9dfbf2961dcc.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_c9d710504e3415cd6c2884f7df804eda.html b/docs/dir_c9d710504e3415cd6c2884f7df804eda.html index e2bea3a..de8dfcc 100644 --- a/docs/dir_c9d710504e3415cd6c2884f7df804eda.html +++ b/docs/dir_c9d710504e3415cd6c2884f7df804eda.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_dd500134467ec65427366f3cbbc5ff81.html b/docs/dir_dd500134467ec65427366f3cbbc5ff81.html index 1e2de4e..83c61a7 100644 --- a/docs/dir_dd500134467ec65427366f3cbbc5ff81.html +++ b/docs/dir_dd500134467ec65427366f3cbbc5ff81.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_de06b53c2e04c67b773395f92873ff7f.html b/docs/dir_de06b53c2e04c67b773395f92873ff7f.html index 5f6d15d..3c3c795 100644 --- a/docs/dir_de06b53c2e04c67b773395f92873ff7f.html +++ b/docs/dir_de06b53c2e04c67b773395f92873ff7f.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_e486d5210108a359e139a984535147fa.html b/docs/dir_e486d5210108a359e139a984535147fa.html index 996bd0d..53152a5 100644 --- a/docs/dir_e486d5210108a359e139a984535147fa.html +++ b/docs/dir_e486d5210108a359e139a984535147fa.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_ec4f48f1c0ac567d297185d46cf69b0c.html b/docs/dir_ec4f48f1c0ac567d297185d46cf69b0c.html index 343fdb3..2b9620c 100644 --- a/docs/dir_ec4f48f1c0ac567d297185d46cf69b0c.html +++ b/docs/dir_ec4f48f1c0ac567d297185d46cf69b0c.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_ede0e87241159758c1b375c196bd55d8.html b/docs/dir_ede0e87241159758c1b375c196bd55d8.html index 4ac3b35..5a618a1 100644 --- a/docs/dir_ede0e87241159758c1b375c196bd55d8.html +++ b/docs/dir_ede0e87241159758c1b375c196bd55d8.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_f324b8056e3921282ea6aa7d15c7705c.html b/docs/dir_f324b8056e3921282ea6aa7d15c7705c.html index 8842f08..eb87241 100644 --- a/docs/dir_f324b8056e3921282ea6aa7d15c7705c.html +++ b/docs/dir_f324b8056e3921282ea6aa7d15c7705c.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_f544411fb6a30872da080b65ab4522b8.html b/docs/dir_f544411fb6a30872da080b65ab4522b8.html index 8b64f2d..699f01f 100644 --- a/docs/dir_f544411fb6a30872da080b65ab4522b8.html +++ b/docs/dir_f544411fb6a30872da080b65ab4522b8.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_f792a45ec812fbfe638a4ac0a7328817.html b/docs/dir_f792a45ec812fbfe638a4ac0a7328817.html index 0dab5ce..1cb04d4 100644 --- a/docs/dir_f792a45ec812fbfe638a4ac0a7328817.html +++ b/docs/dir_f792a45ec812fbfe638a4ac0a7328817.html @@ -22,7 +22,7 @@ diff --git a/docs/dir_f803ec176eda9a8494dc55dc57236527.html b/docs/dir_f803ec176eda9a8494dc55dc57236527.html index 6e7ae3f..ba586bc 100644 --- a/docs/dir_f803ec176eda9a8494dc55dc57236527.html +++ b/docs/dir_f803ec176eda9a8494dc55dc57236527.html @@ -22,7 +22,7 @@ diff --git a/docs/files.html b/docs/files.html index a79deb0..fbffe04 100644 --- a/docs/files.html +++ b/docs/files.html @@ -22,7 +22,7 @@ diff --git a/docs/functions.html b/docs/functions.html index 2c6a3ec..9ac2e7c 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -22,7 +22,7 @@ @@ -71,9 +71,6 @@ $(function() {
  • _format_log : clutchlog
  • -
  • _hfill_char -: clutchlog -
  • _in_file : clutchlog
  • @@ -96,7 +93,7 @@ $(function() { : clutchlog
  • _strip_calls -: clutchlog +: clutchlog
  • _word_level : clutchlog @@ -124,6 +121,9 @@ $(function() {
  • default_hfill_char : clutchlog
  • +
  • default_hfill_max +: clutchlog +
  • default_strip_calls : clutchlog
  • diff --git a/docs/functions_enum.html b/docs/functions_enum.html index 39e4edd..38689b2 100644 --- a/docs/functions_enum.html +++ b/docs/functions_enum.html @@ -22,7 +22,7 @@
    diff --git a/docs/functions_func.html b/docs/functions_func.html index 28fa9d2..db88253 100644 --- a/docs/functions_func.html +++ b/docs/functions_func.html @@ -22,7 +22,7 @@ diff --git a/docs/functions_rela.html b/docs/functions_rela.html index 24af82d..1bae57a 100644 --- a/docs/functions_rela.html +++ b/docs/functions_rela.html @@ -22,7 +22,7 @@ diff --git a/docs/functions_vars.html b/docs/functions_vars.html index fde113b..49ef744 100644 --- a/docs/functions_vars.html +++ b/docs/functions_vars.html @@ -22,7 +22,7 @@ @@ -69,9 +69,6 @@ $(function() {
  • _format_log : clutchlog
  • -
  • _hfill_char -: clutchlog -
  • _in_file : clutchlog
  • @@ -94,7 +91,7 @@ $(function() { : clutchlog
  • _strip_calls -: clutchlog +: clutchlog
  • _word_level : clutchlog @@ -111,6 +108,9 @@ $(function() {
  • default_hfill_char : clutchlog
  • +
  • default_hfill_max +: clutchlog +
  • default_strip_calls : clutchlog
  • diff --git a/docs/globals.html b/docs/globals.html index 8191389..430d0a5 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -22,7 +22,7 @@
    diff --git a/docs/globals_defs.html b/docs/globals_defs.html index 9c9291f..ddfecb4 100644 --- a/docs/globals_defs.html +++ b/docs/globals_defs.html @@ -22,7 +22,7 @@ diff --git a/docs/graph_legend.html b/docs/graph_legend.html index 56d11c1..f2d2f79 100644 --- a/docs/graph_legend.html +++ b/docs/graph_legend.html @@ -22,7 +22,7 @@ diff --git a/docs/group__DefaultConfigMacros.html b/docs/group__DefaultConfigMacros.html index ed7b71a..6a54d7c 100644 --- a/docs/group__DefaultConfigMacros.html +++ b/docs/group__DefaultConfigMacros.html @@ -22,7 +22,7 @@ diff --git a/docs/group__Formating.html b/docs/group__Formating.html index a699437..f8c8e8c 100644 --- a/docs/group__Formating.html +++ b/docs/group__Formating.html @@ -22,7 +22,7 @@ diff --git a/docs/group__Main.html b/docs/group__Main.html index 4386669..10fbdb3 100644 --- a/docs/group__Main.html +++ b/docs/group__Main.html @@ -22,7 +22,7 @@ diff --git a/docs/group__UseMacros.html b/docs/group__UseMacros.html index e0b4568..4f7b910 100644 --- a/docs/group__UseMacros.html +++ b/docs/group__UseMacros.html @@ -22,7 +22,7 @@ @@ -229,6 +229,10 @@ static unsigned int  + + + @@ -282,10 +286,10 @@ High-level API

    Macros

    +#define CLUTCHLOG_H
     
    #define CLUTCHLOG_HAVE_UNIX_SYSINFO   0
     POSIX headers necessary for stack depth management are available.
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    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.
    - - - + + + @@ -306,10 +310,6 @@ std::string  - - - @@ -837,11 +837,11 @@ template<class ... FMT> -
    static clutchlog & logger()
    Get the logger instance.
    Definition: clutchlog.h:273
    +
    static clutchlog & logger()
    Get the logger instance.
    Definition: clutchlog.h:286
    #define CLUTCHDUMP_DEFAULT_SEP
    Compile-time default item separator for dump.
    Definition: clutchlog.h:235
    -
    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:814
    +
    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:860
    #define CLUTCHLOC
    Handy shortcuts to location.
    Definition: clutchlog.h:75
    -
    Color and style formatter for ANSI terminal escape sequences.
    Definition: clutchlog.h:294
    +
    Color and style formatter for ANSI terminal escape sequences.
    Definition: clutchlog.h:307
    @@ -70,19 +70,20 @@ $(function() { -

    Clutchlog logo

    +

    +

    <img alt"Clutchlog logo" src="https://raw.githubusercontent.com/nojhan/clutchlog/master/docs/clutchlog_logo.svg" width="400" />

    Features

    Clutchlog allows to select which log messages will be displayed, based on their locations:

    @@ -124,22 +126,8 @@ Rationale

    While tracing a bug, it is tedious to uncomment old debugging code (and go on the build-test cycle) or to set up a full debugger session that displays all appropriate data (with ad-hoc fancy hooks).

    To solve this problem, Clutchlog allows to disengage your debug log messages in various parts of the program, allowing for the fast tracking of a bug across the execution.

    -API documentation

    +Basic Usage

    -Log level semantics

    -

    Log levels use a classical semantics for a human skilled in the art, in decreasing order of importance:

    -
      -
    • Critical: an error that cannot be recovered. For instance, something which will make a server stop right here.
    • -
    • Error: an error that invalidates a function, but may still be recovered. For example, a bad user input that will make a server reset its state, but not crash.
    • -
    • Warning: something that is strange, but is probably legit. For example a default parameter is set because the user forgot to indicate its preference.
    • -
    • Progress: the state at which computation currently is.
    • -
    • Note: some state worth noting to understand what's going on.
    • -
    • Info: any information that would help ensuring that everything is going well.
    • -
    • Debug: data that would help debugging the program if there was a bug later on.
    • -
    • XDebug: debugging information that would be heavy to read.
    • -
    -

    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).

    -

    Calls

    The main entrypoint is the CLUTCHLOG macro, which takes the desired log level and message. The message can be anything that can be output in an ostringstream.

    // Simple string:
    CLUTCHLOG(info, "hello world");
    @@ -160,6 +148,20 @@ Calls
    * 1681692777
    */

    Note that if you pass a file name without the {n} tag, the file will be overwritten as is.

    +

    +Log level semantics

    +

    Log levels use a classical semantics for a human skilled in the art, in decreasing order of importance:

    +
      +
    • Critical: an error that cannot be recovered. For instance, something which will make a server stop right here.
    • +
    • Error: an error that invalidates a function, but may still be recovered. For example, a bad user input that will make a server reset its state, but not crash.
    • +
    • Warning: something that is strange, but is probably legit. For example a default parameter is set because the user forgot to indicate its preference.
    • +
    • Progress: the state at which computation currently is.
    • +
    • Note: some state worth noting to understand what's going on.
    • +
    • Info: any information that would help ensuring that everything is going well.
    • +
    • Debug: data that would help debugging the program if there was a bug later on.
    • +
    • XDebug: debugging information that would be heavy to read.
    • +
    +

    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).

    Location filtering

    To configure the global behaviour of the logger, you must first get a reference on its (singleton) instance:

    auto& log = clutchlog::logger();
    @@ -201,11 +203,11 @@ Output Configuration

    Marks

    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:

    log.depth_mark(CLUTCHLOG_DEFAULT_DEPTH_MARK); // Defaults to ">".

    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:

    log.hfill_mark(CLUTCHLOG_DEFAULT_HFILL_MARK); // Defaults to '.'.
    -

    Note: if the system detects no terminal, only a single fill character is inserted.

    -

    -Stack Depth

    +

    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).

    log.hfill_max(CLUTCHLOG_DEFAULT_HFILL_MAX); // Defaults to 300.
    +

    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.

    +

    Stack Depth

    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

    The output can be colored differently depending on the log level.

    // Print error messages in bold red:
    log.style(clutchlog::level::error, // First, the log level.
    @@ -251,11 +253,14 @@ Output style
    << fmt(fmt::typo::reset) << " {msg}" << std::endl; // This is a reset.
    log.format(format.str());

    Note: 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:

    log.hfill_style(clutchlog::fmt::fg::black);
    +

    +Advanced Usage

    Disabled 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).

    You can however force clutchlog to be enabled in any build type by setting the WITH_CLUTCHLOG preprocessor variable.

    -

    When the NDEBUG preprocessor variable is set (e.g. in Release build), clutchlog will do its best to allow the compiler to optimize out any calls for log levels that are under or equal to progress.

    +

    When the NDEBUG preprocessor variable is set (e.g. in Release build), clutchlog will do its best to allow the compiler to optimize out any calls for log levels that are under progress.

    You can change this behavior at compile time by setting the CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG preprocessor variable to the desired maximum log level, for example:

    // Will always allow to log everything even in Release mode.
    #define CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG clutchlog::level::xdebug

    Note that allowing a log level does not mean that it will actually output something. If the configured log level at runtime is lower than the log level of the message, it will still not be printed.

    @@ -280,12 +285,53 @@ Low-level API
    std::clog << "We are clutched!\n";
    );

    -Limitations

    -

    System-dependent stack depth

    -

    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:

    #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
    +Examples +

    Here what you would do to setup clutchlog with the default configuration:

    auto& log = clutchlog::logger();
    +
    log.out(std::clog);
    +
    // Location filtering.
    +
    log.depth(std::numeric_limits<size_t>::max());
    +
    log.threshold("Error");
    +
    log.file(".*");
    +
    log.func(".*");
    +
    // Colors of the 3 firsts levels.
    +
    log.style(clutchlog::level::critical, clutchlog::fmt(
    +
    clutchlog::fmt::fg::red,
    +
    clutchlog::fmt::typo::underline);
    +
    log.style(clutchlog::level::error, clutchlog::fmt(
    +
    clutchlog::fmt::fg::red,
    +
    clutchlog::fmt::typo::bold);
    +
    log.style(clutchlog::level::warning, clutchlog::fmt(
    +
    clutchlog::fmt::fg::magenta,
    +
    clutchlog::fmt::typo::bold);
    +
    // Assuming you are on a POSIX system.
    +
    log.format("[{name}] {level_letter}:{depth_marks} {msg} {hfill} {func} @ {file}:{line}\n");
    +
    log.depth_mark(">");
    +
    log.strip_calls(5);
    +
    log.hfill_char('.');
    +
    log.hfill_max(300);
    +
    log.hfill_style(clutchlog::fmt::fg::none);
    +

    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);

    Limitations
    +
    ===========
    +
    +
    ### System-dependent stack depth
    +
    +
    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:
    +
    ```cpp
    +
    #if CLUTCHLOG_HAVE_UNIX_SYSINFO == 1
    log.depth( x );
    -
    #endif
    +
    #endif

    System-dependent horizontal fill

    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:

    #if CLUTCHLOG_HAVE_UNIX_SYSIOCTL == 1
    @@ -323,12 +369,13 @@ Build and tests

    There's a script that tests all the build types combinations: ./build_all.sh.

    -
    static clutchlog & logger()
    Get the logger instance.
    Definition: clutchlog.h:273
    +
    static clutchlog & logger()
    Get the logger instance.
    Definition: clutchlog.h:286
    #define CLUTCHLOG(LEVEL, WHAT)
    Log a message at the given level.
    Definition: clutchlog.h:79
    #define CLUTCHLOG_DEFAULT_DEPTH_MARK
    Compile-time default mark for stack depth.
    Definition: clutchlog.h:242
    +
    enum clutchlog::fmt::typo style
    Typographic style.
    #define CLUTCHLOC
    Handy shortcuts to location.
    Definition: clutchlog.h:75
    #define CLUTCHCODE(LEVEL,...)
    Run any code if the scope matches.
    Definition: clutchlog.h:134
    -
    Color and style formatter for ANSI terminal escape sequences.
    Definition: clutchlog.h:294
    +
    Color and style formatter for ANSI terminal escape sequences.
    Definition: clutchlog.h:307
    #define CLUTCHDUMP(LEVEL, CONTAINER, FILENAME)
    Dump the given container.
    Definition: clutchlog.h:96
    diff --git a/docs/search/all_0.js b/docs/search/all_0.js index 5eeda3e..150660c 100644 --- a/docs/search/all_0.js +++ b/docs/search/all_0.js @@ -2,14 +2,13 @@ var searchData= [ ['_5fformat_5fdump_0',['_format_dump',['../group__UseMacros.html#ga5f4ddb57ce42e8be86a7c7d269f7bae5',1,'clutchlog']]], ['_5fformat_5flog_1',['_format_log',['../group__UseMacros.html#ga7c6e3fc082bc6f55d50131ed2b32e81e',1,'clutchlog']]], - ['_5fhfill_5fchar_2',['_hfill_char',['../group__UseMacros.html#gae24e7530a131344f53e3e794b913845a',1,'clutchlog']]], - ['_5fin_5ffile_3',['_in_file',['../group__UseMacros.html#gaded03528f34d9000f618419c482c5042',1,'clutchlog']]], - ['_5fin_5ffunc_4',['_in_func',['../group__UseMacros.html#ga130c4f12eacbd2028102838fe16b734e',1,'clutchlog']]], - ['_5fin_5fline_5',['_in_line',['../group__UseMacros.html#ga41757198b29862832a14472a9e5e24c6',1,'clutchlog']]], - ['_5flevel_5ffmt_6',['_level_fmt',['../group__UseMacros.html#gab805ac5c33885459f9f752518a4aa735',1,'clutchlog']]], - ['_5flevel_5fword_7',['_level_word',['../group__UseMacros.html#gab1c377a376e6772fe1746ff7147c125f',1,'clutchlog']]], - ['_5fout_8',['_out',['../group__UseMacros.html#ga1896f6c4b8597e3e76ff93970bd85167',1,'clutchlog']]], - ['_5fstage_9',['_stage',['../group__UseMacros.html#gaeb60684c89bcef5aa9273075c21cc993',1,'clutchlog']]], - ['_5fstrip_5fcalls_10',['_strip_calls',['../group__UseMacros.html#ga56ed762c056c5b1d0020863b11bd188e',1,'clutchlog']]], - ['_5fword_5flevel_11',['_word_level',['../group__UseMacros.html#gabd4625bf211bfbaa30d9c126fa3d7888',1,'clutchlog']]] + ['_5fin_5ffile_2',['_in_file',['../group__UseMacros.html#gaded03528f34d9000f618419c482c5042',1,'clutchlog']]], + ['_5fin_5ffunc_3',['_in_func',['../group__UseMacros.html#ga130c4f12eacbd2028102838fe16b734e',1,'clutchlog']]], + ['_5fin_5fline_4',['_in_line',['../group__UseMacros.html#ga41757198b29862832a14472a9e5e24c6',1,'clutchlog']]], + ['_5flevel_5ffmt_5',['_level_fmt',['../group__UseMacros.html#gab805ac5c33885459f9f752518a4aa735',1,'clutchlog']]], + ['_5flevel_5fword_6',['_level_word',['../group__UseMacros.html#gab1c377a376e6772fe1746ff7147c125f',1,'clutchlog']]], + ['_5fout_7',['_out',['../group__UseMacros.html#ga1896f6c4b8597e3e76ff93970bd85167',1,'clutchlog']]], + ['_5fstage_8',['_stage',['../group__UseMacros.html#gaeb60684c89bcef5aa9273075c21cc993',1,'clutchlog']]], + ['_5fstrip_5fcalls_9',['_strip_calls',['../group__UseMacros.html#ga356df86455409193792b6ed550dfd09e',1,'clutchlog']]], + ['_5fword_5flevel_10',['_word_level',['../group__UseMacros.html#gabd4625bf211bfbaa30d9c126fa3d7888',1,'clutchlog']]] ]; diff --git a/docs/search/all_1.js b/docs/search/all_1.js index 7975790..7c3ab2e 100644 --- a/docs/search/all_1.js +++ b/docs/search/all_1.js @@ -1,5 +1,5 @@ var searchData= [ - ['back_12',['back',['../group__UseMacros.html#ga86696b20e5b31c96ba592926efb324f3',1,'clutchlog::fmt']]], - ['bg_13',['bg',['../group__UseMacros.html#ga1cf3e27e4041250ffea0a6d58010da1e',1,'clutchlog::fmt']]] + ['back_11',['back',['../group__UseMacros.html#ga86696b20e5b31c96ba592926efb324f3',1,'clutchlog::fmt']]], + ['bg_12',['bg',['../group__UseMacros.html#ga1cf3e27e4041250ffea0a6d58010da1e',1,'clutchlog::fmt']]] ]; diff --git a/docs/search/all_2.js b/docs/search/all_2.js index 4cf9bcc..2f63e53 100644 --- a/docs/search/all_2.js +++ b/docs/search/all_2.js @@ -1,18 +1,18 @@ var searchData= [ - ['clutchcode_14',['CLUTCHCODE',['../group__UseMacros.html#gaaf2e85e1153e6c88b458dd49e3c37c73',1,'clutchlog.h']]], - ['clutchdump_15',['CLUTCHDUMP',['../group__UseMacros.html#ga572e3aa19d8b39e3ed0b9e91961104c2',1,'clutchlog.h']]], - ['clutchdump_5fdefault_5fformat_16',['CLUTCHDUMP_DEFAULT_FORMAT',['../group__UseMacros.html#ga27b613c6727857a7cbcd0165d862034e',1,'clutchlog.h']]], - ['clutchdump_5fdefault_5fsep_17',['CLUTCHDUMP_DEFAULT_SEP',['../group__UseMacros.html#ga54d29e956575e1c731eab5406135c5df',1,'clutchlog.h']]], - ['clutchfunc_18',['CLUTCHFUNC',['../group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae',1,'clutchlog.h']]], - ['clutchloc_19',['CLUTCHLOC',['../group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813',1,'clutchlog.h']]], - ['clutchlog_20',['clutchlog',['../classclutchlog.html',1,'clutchlog'],['../group__UseMacros.html#ga6f86187e2b35e7e1907d688f504a197d',1,'CLUTCHLOG(): clutchlog.h']]], - ['clutchlog_2eh_21',['clutchlog.h',['../clutchlog_8h.html',1,'']]], - ['clutchlog_5fdefault_5fdepth_5fbuilt_5fnodebug_22',['CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG',['../group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415',1,'clutchlog.h']]], - ['clutchlog_5fdefault_5fdepth_5fmark_23',['CLUTCHLOG_DEFAULT_DEPTH_MARK',['../group__UseMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9',1,'clutchlog.h']]], - ['clutchlog_5fdefault_5fformat_24',['CLUTCHLOG_DEFAULT_FORMAT',['../group__UseMacros.html#ga524c16f280d92ee8ab683162c9ce01fa',1,'clutchlog.h']]], - ['clutchlog_5fhave_5funix_5fsysinfo_25',['CLUTCHLOG_HAVE_UNIX_SYSINFO',['../clutchlog_8h.html#a6bbcf13504687db4dbe0474931d867fb',1,'clutchlog.h']]], - ['clutchlog_5fhfill_5fmark_26',['CLUTCHLOG_HFILL_MARK',['../group__UseMacros.html#gad5fbbacf74b8e4669b8f9efdfe81bd25',1,'clutchlog.h']]], - ['clutchlog_5fstrip_5fcalls_27',['CLUTCHLOG_STRIP_CALLS',['../group__UseMacros.html#ga98f30d814d4913a8a7c93a8793f49adf',1,'clutchlog.h']]], - ['clutchlog_20—_20versatile_20_28de_29clutchable_20logging_28',['Clutchlog — versatile (de)clutchable logging',['../index.html',1,'']]] + ['clutchcode_13',['CLUTCHCODE',['../group__UseMacros.html#gaaf2e85e1153e6c88b458dd49e3c37c73',1,'clutchlog.h']]], + ['clutchdump_14',['CLUTCHDUMP',['../group__UseMacros.html#ga572e3aa19d8b39e3ed0b9e91961104c2',1,'clutchlog.h']]], + ['clutchdump_5fdefault_5fformat_15',['CLUTCHDUMP_DEFAULT_FORMAT',['../group__UseMacros.html#ga27b613c6727857a7cbcd0165d862034e',1,'clutchlog.h']]], + ['clutchdump_5fdefault_5fsep_16',['CLUTCHDUMP_DEFAULT_SEP',['../group__UseMacros.html#ga54d29e956575e1c731eab5406135c5df',1,'clutchlog.h']]], + ['clutchfunc_17',['CLUTCHFUNC',['../group__UseMacros.html#ga9f77cee4f853e582262930c9c17f90ae',1,'clutchlog.h']]], + ['clutchloc_18',['CLUTCHLOC',['../group__UseMacros.html#gae8911119d726a43b77f5781cb5a72813',1,'clutchlog.h']]], + ['clutchlog_19',['clutchlog',['../classclutchlog.html',1,'clutchlog'],['../group__UseMacros.html#ga6f86187e2b35e7e1907d688f504a197d',1,'CLUTCHLOG(): clutchlog.h']]], + ['clutchlog_2eh_20',['clutchlog.h',['../clutchlog_8h.html',1,'']]], + ['clutchlog_5fdefault_5fdepth_5fbuilt_5fnodebug_21',['CLUTCHLOG_DEFAULT_DEPTH_BUILT_NODEBUG',['../group__DefaultConfigMacros.html#ga8564be479b948ee3052b61783c66d415',1,'clutchlog.h']]], + ['clutchlog_5fdefault_5fdepth_5fmark_22',['CLUTCHLOG_DEFAULT_DEPTH_MARK',['../group__UseMacros.html#ga45c4c964fad4ad1641d5c9c28c4645b9',1,'clutchlog.h']]], + ['clutchlog_5fdefault_5fformat_23',['CLUTCHLOG_DEFAULT_FORMAT',['../group__UseMacros.html#ga524c16f280d92ee8ab683162c9ce01fa',1,'clutchlog.h']]], + ['clutchlog_5fhave_5funix_5fsysinfo_24',['CLUTCHLOG_HAVE_UNIX_SYSINFO',['../clutchlog_8h.html#a6bbcf13504687db4dbe0474931d867fb',1,'clutchlog.h']]], + ['clutchlog_5fhfill_5fmark_25',['CLUTCHLOG_HFILL_MARK',['../group__UseMacros.html#gad5fbbacf74b8e4669b8f9efdfe81bd25',1,'clutchlog.h']]], + ['clutchlog_5fstrip_5fcalls_26',['CLUTCHLOG_STRIP_CALLS',['../group__UseMacros.html#ga98f30d814d4913a8a7c93a8793f49adf',1,'clutchlog.h']]], + ['clutchlog_20—_20versatile_20_28de_29clutchable_20logging_27',['Clutchlog — versatile (de)clutchable logging',['../index.html',1,'']]] ]; diff --git a/docs/search/all_3.js b/docs/search/all_3.js index b46f963..5870658 100644 --- a/docs/search/all_3.js +++ b/docs/search/all_3.js @@ -1,8 +1,9 @@ var searchData= [ - ['default_5fdepth_5fmark_29',['default_depth_mark',['../group__UseMacros.html#ga229fd61519f1245282440120f2d45fb5',1,'clutchlog']]], - ['default_5fformat_30',['default_format',['../group__UseMacros.html#ga0c4ac57601e6f8d146fd5cc060968ecc',1,'clutchlog']]], - ['default_5fhfill_5fchar_31',['default_hfill_char',['../group__UseMacros.html#ga76eb34537b634aadb75e255f7887eeb6',1,'clutchlog']]], + ['default_5fdepth_5fmark_28',['default_depth_mark',['../group__UseMacros.html#ga229fd61519f1245282440120f2d45fb5',1,'clutchlog']]], + ['default_5fformat_29',['default_format',['../group__UseMacros.html#ga0c4ac57601e6f8d146fd5cc060968ecc',1,'clutchlog']]], + ['default_5fhfill_5fchar_30',['default_hfill_char',['../group__UseMacros.html#ga76eb34537b634aadb75e255f7887eeb6',1,'clutchlog']]], + ['default_5fhfill_5fmax_31',['default_hfill_max',['../group__UseMacros.html#gaa3c8e8ef6a1729b95b48f9001fc8b4c6',1,'clutchlog']]], ['default_5fstrip_5fcalls_32',['default_strip_calls',['../group__UseMacros.html#ga1a8cb6411726133208f5a2f2cb42d468',1,'clutchlog']]], ['default_20configuration_20macros_33',['Default configuration macros',['../group__DefaultConfigMacros.html',1,'']]], ['dump_34',['dump',['../group__UseMacros.html#ga63308e8deae3cfec6801318203494143',1,'clutchlog']]], diff --git a/docs/search/variables_0.js b/docs/search/variables_0.js index c662085..0394a51 100644 --- a/docs/search/variables_0.js +++ b/docs/search/variables_0.js @@ -2,14 +2,13 @@ var searchData= [ ['_5fformat_5fdump_92',['_format_dump',['../group__UseMacros.html#ga5f4ddb57ce42e8be86a7c7d269f7bae5',1,'clutchlog']]], ['_5fformat_5flog_93',['_format_log',['../group__UseMacros.html#ga7c6e3fc082bc6f55d50131ed2b32e81e',1,'clutchlog']]], - ['_5fhfill_5fchar_94',['_hfill_char',['../group__UseMacros.html#gae24e7530a131344f53e3e794b913845a',1,'clutchlog']]], - ['_5fin_5ffile_95',['_in_file',['../group__UseMacros.html#gaded03528f34d9000f618419c482c5042',1,'clutchlog']]], - ['_5fin_5ffunc_96',['_in_func',['../group__UseMacros.html#ga130c4f12eacbd2028102838fe16b734e',1,'clutchlog']]], - ['_5fin_5fline_97',['_in_line',['../group__UseMacros.html#ga41757198b29862832a14472a9e5e24c6',1,'clutchlog']]], - ['_5flevel_5ffmt_98',['_level_fmt',['../group__UseMacros.html#gab805ac5c33885459f9f752518a4aa735',1,'clutchlog']]], - ['_5flevel_5fword_99',['_level_word',['../group__UseMacros.html#gab1c377a376e6772fe1746ff7147c125f',1,'clutchlog']]], - ['_5fout_100',['_out',['../group__UseMacros.html#ga1896f6c4b8597e3e76ff93970bd85167',1,'clutchlog']]], - ['_5fstage_101',['_stage',['../group__UseMacros.html#gaeb60684c89bcef5aa9273075c21cc993',1,'clutchlog']]], - ['_5fstrip_5fcalls_102',['_strip_calls',['../group__UseMacros.html#ga56ed762c056c5b1d0020863b11bd188e',1,'clutchlog']]], - ['_5fword_5flevel_103',['_word_level',['../group__UseMacros.html#gabd4625bf211bfbaa30d9c126fa3d7888',1,'clutchlog']]] + ['_5fin_5ffile_94',['_in_file',['../group__UseMacros.html#gaded03528f34d9000f618419c482c5042',1,'clutchlog']]], + ['_5fin_5ffunc_95',['_in_func',['../group__UseMacros.html#ga130c4f12eacbd2028102838fe16b734e',1,'clutchlog']]], + ['_5fin_5fline_96',['_in_line',['../group__UseMacros.html#ga41757198b29862832a14472a9e5e24c6',1,'clutchlog']]], + ['_5flevel_5ffmt_97',['_level_fmt',['../group__UseMacros.html#gab805ac5c33885459f9f752518a4aa735',1,'clutchlog']]], + ['_5flevel_5fword_98',['_level_word',['../group__UseMacros.html#gab1c377a376e6772fe1746ff7147c125f',1,'clutchlog']]], + ['_5fout_99',['_out',['../group__UseMacros.html#ga1896f6c4b8597e3e76ff93970bd85167',1,'clutchlog']]], + ['_5fstage_100',['_stage',['../group__UseMacros.html#gaeb60684c89bcef5aa9273075c21cc993',1,'clutchlog']]], + ['_5fstrip_5fcalls_101',['_strip_calls',['../group__UseMacros.html#ga356df86455409193792b6ed550dfd09e',1,'clutchlog']]], + ['_5fword_5flevel_102',['_word_level',['../group__UseMacros.html#gabd4625bf211bfbaa30d9c126fa3d7888',1,'clutchlog']]] ]; diff --git a/docs/search/variables_1.js b/docs/search/variables_1.js index 256e58f..bc8fc6a 100644 --- a/docs/search/variables_1.js +++ b/docs/search/variables_1.js @@ -1,4 +1,4 @@ var searchData= [ - ['back_104',['back',['../group__UseMacros.html#ga86696b20e5b31c96ba592926efb324f3',1,'clutchlog::fmt']]] + ['back_103',['back',['../group__UseMacros.html#ga86696b20e5b31c96ba592926efb324f3',1,'clutchlog::fmt']]] ]; diff --git a/docs/search/variables_2.js b/docs/search/variables_2.js index 9e14f73..7e868b7 100644 --- a/docs/search/variables_2.js +++ b/docs/search/variables_2.js @@ -1,8 +1,9 @@ var searchData= [ - ['default_5fdepth_5fmark_105',['default_depth_mark',['../group__UseMacros.html#ga229fd61519f1245282440120f2d45fb5',1,'clutchlog']]], - ['default_5fformat_106',['default_format',['../group__UseMacros.html#ga0c4ac57601e6f8d146fd5cc060968ecc',1,'clutchlog']]], - ['default_5fhfill_5fchar_107',['default_hfill_char',['../group__UseMacros.html#ga76eb34537b634aadb75e255f7887eeb6',1,'clutchlog']]], + ['default_5fdepth_5fmark_104',['default_depth_mark',['../group__UseMacros.html#ga229fd61519f1245282440120f2d45fb5',1,'clutchlog']]], + ['default_5fformat_105',['default_format',['../group__UseMacros.html#ga0c4ac57601e6f8d146fd5cc060968ecc',1,'clutchlog']]], + ['default_5fhfill_5fchar_106',['default_hfill_char',['../group__UseMacros.html#ga76eb34537b634aadb75e255f7887eeb6',1,'clutchlog']]], + ['default_5fhfill_5fmax_107',['default_hfill_max',['../group__UseMacros.html#gaa3c8e8ef6a1729b95b48f9001fc8b4c6',1,'clutchlog']]], ['default_5fstrip_5fcalls_108',['default_strip_calls',['../group__UseMacros.html#ga1a8cb6411726133208f5a2f2cb42d468',1,'clutchlog']]], ['dump_5fdefault_5fformat_109',['dump_default_format',['../group__UseMacros.html#gace879554298e6e6e36dafef330c27be8',1,'clutchlog']]], ['dump_5fdefault_5fsep_110',['dump_default_sep',['../group__UseMacros.html#gaf898bffe23b125245e338d7495c76d45',1,'clutchlog']]] diff --git a/docs/structclutchlog_1_1scope__t-members.html b/docs/structclutchlog_1_1scope__t-members.html index dfb6a64..e90977c 100644 --- a/docs/structclutchlog_1_1scope__t-members.html +++ b/docs/structclutchlog_1_1scope__t-members.html @@ -22,7 +22,7 @@ diff --git a/docs/structclutchlog_1_1scope__t.html b/docs/structclutchlog_1_1scope__t.html index 67ecb3f..e2f3a66 100644 --- a/docs/structclutchlog_1_1scope__t.html +++ b/docs/structclutchlog_1_1scope__t.html @@ -22,7 +22,7 @@

    Internal details

    -const size_t clutchlog::_strip_calls
     Current number of call stack levels to remove from depth display.
     
    +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.
    clutchlog::_format_dump
     Current format of the file output.
     
    -char clutchlog::_hfill_char
     Character for filling.
     
    std::ostream * clutchlog::_out
     Standard output.
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9
    clutchlog -  0.8 +  0.9