Skip to content

Commit 7da54d8

Browse files
committed
Make debug logging configurable
1 parent 97effbf commit 7da54d8

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ See [./examples/repeat.cpp](./examples/repeat.cpp)
2929

3030
MIT, see [./LICENSE](./LICENSE)
3131

32+
## Debugging
33+
34+
To enable debug logging, set the `MSGFLO_CPP_DEBUG` environment variable.
35+
36+
export MSGFLO_CPP_DEBUG=1
37+
3238
## TODO
3339

3440
0.1

examples/repeat.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ int main(int argc, char **argv)
2929
if (argc >= 3) {
3030
config.url(argv[2]);
3131
}
32-
config.debugOutput(true);
3332

3433
auto engine = msgflo::createEngine(config);
3534

include/msgflo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ class Engine {
106106

107107
class EngineConfig {
108108
public:
109-
EngineConfig() : _debugOutput(true) {
109+
EngineConfig() : _debugOutput(false) {
110+
_debugOutput = std::getenv("MSGFLO_CPP_DEBUG") ? true : false;
110111
}
111112

112113
void debugOutput(bool on) {

0 commit comments

Comments
 (0)