forked from Telodendria/Telodendria
Only install the memory hook if -v is given.
This way, we can still set the debug level in the configuration, and not see the log just absolutely flooded with memory allocations and whatnot. This is helpful because I want debug messages to show up in development, but not in production, but having all the memory logging makes it almost impossible to pick anything else out of the log. I want the feature available, just not on by default because it's useful in limited circumstances.
This commit is contained in:
parent
9ec330f40a
commit
089d8d4d94
2 changed files with 2 additions and 3 deletions
|
@ -7,7 +7,7 @@
|
||||||
"threads": 2,
|
"threads": 2,
|
||||||
"log": {
|
"log": {
|
||||||
"output": "stdout",
|
"output": "stdout",
|
||||||
"//level": "debug",
|
"level": "debug",
|
||||||
"timestampFormat": "none",
|
"timestampFormat": "none",
|
||||||
"color": true
|
"color": true
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,8 +111,6 @@ main(int argc, char **argv)
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MemoryHook(TelodendriaMemoryHook, NULL);
|
|
||||||
|
|
||||||
TelodendriaPrintHeader();
|
TelodendriaPrintHeader();
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "f:Vvn")) != -1)
|
while ((opt = getopt(argc, argv, "f:Vvn")) != -1)
|
||||||
|
@ -142,6 +140,7 @@ main(int argc, char **argv)
|
||||||
if (flags & ARG_VERBOSE)
|
if (flags & ARG_VERBOSE)
|
||||||
{
|
{
|
||||||
LogConfigLevelSet(LogConfigGlobal(), LOG_DEBUG);
|
LogConfigLevelSet(LogConfigGlobal(), LOG_DEBUG);
|
||||||
|
MemoryHook(TelodendriaMemoryHook, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & ARG_VERSION)
|
if (flags & ARG_VERSION)
|
||||||
|
|
Loading…
Reference in a new issue