Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed Jul 5, 2019
1 parent b87dae9 commit d7f94f8
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test/index
test/demo
deps
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,33 @@ DEBUG=bands ./musicprogram
```c++
#include "./deps/heapwolf/debug/index.hxx"

Debug d("bands");

//
// The instance can then be called with any number of arbitrary types.
//
d("danzig", 100, 'x');
Debug debug("demo");
Debug debug3("demo:beep");

int f3 () {
Debug debug2("demo:boop");
debug2("running function f3");
debug3("running function f3");
return 0;
}


int f2 () {
debug("running function f2");
return f3();
}

int main () {
debug("starting program");
f2();
debug("ending program");
return 0;
}
```
#### OUTPUT
![example](/docs/screenshot.png)
```
bands danzig 100 x
```
# TEST
Expand Down
Binary file added docs/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions index.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class Debug {
if (!std::regex_match(this->name, std::regex(res))) {
return; // the env var does not contain the name
}
} else {
return;
}

//
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
"clang++ -std=c++2a -stdlib=libc++",
"test/index.cxx -o test/index && ./test/index"
],
"install": ""
"demo": [
"clang++ -std=c++2a -stdlib=libc++",
"test/demo.cxx -o test/demo && ./test/demo"
]
},
"flags": [
"-std=c++2a",
Expand Down
24 changes: 24 additions & 0 deletions test/demo.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "../index.hxx"

Debug debug("demo");
Debug debug3("demo:beep");

int f3 () {
Debug debug2("demo:boop");
debug2("running function f3");
debug3("running function f3");
return 0;
}


int f2 () {
debug("running function f2");
return f3();
}

int main () {
debug("starting program");
f2();
debug("ending program");
return 0;
}

0 comments on commit d7f94f8

Please sign in to comment.