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:
Jordan Bancino 2023-03-22 18:29:05 +00:00
parent 9ec330f40a
commit 089d8d4d94
2 changed files with 2 additions and 3 deletions

View file

@ -7,7 +7,7 @@
"threads": 2,
"log": {
"output": "stdout",
"//level": "debug",
"level": "debug",
"timestampFormat": "none",
"color": true
}

View file

@ -111,8 +111,6 @@ main(int argc, char **argv)
return EXIT_FAILURE;
}
MemoryHook(TelodendriaMemoryHook, NULL);
TelodendriaPrintHeader();
while ((opt = getopt(argc, argv, "f:Vvn")) != -1)
@ -142,6 +140,7 @@ main(int argc, char **argv)
if (flags & ARG_VERBOSE)
{
LogConfigLevelSet(LogConfigGlobal(), LOG_DEBUG);
MemoryHook(TelodendriaMemoryHook, NULL);
}
if (flags & ARG_VERSION)