doc: README.md example
This commit is contained in:
parent
8a1f29a44b
commit
45988211c7
1 changed files with 31 additions and 1 deletions
32
README.md
32
README.md
|
|
@ -1 +1,31 @@
|
|||
# nestlog
|
||||
# nestlog -- logging with automatic indenting according to call graph
|
||||
|
||||
Nestlog is a lightweight header-only library for console logging.
|
||||
|
||||
## Examples
|
||||
|
||||
```
|
||||
/* examples/ex1/ex1.cpp */
|
||||
|
||||
#include "nestlog/scope.hpp"
|
||||
|
||||
using namespace xo;
|
||||
|
||||
void A(int x) {
|
||||
XO_SCOPE(log) // i.e. xo::scope log("A");
|
||||
|
||||
log(":x ", x);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char ** argv) {
|
||||
A(66);
|
||||
}
|
||||
```
|
||||
|
||||
output:
|
||||
```
|
||||
+A
|
||||
:x 66
|
||||
-A
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue