Disable console notification by default within the library

As a library, the default shouldn't be to write anything on console.
`cover` and `fastcover` have a `g_displayLevel` variable to control this behavior.
It's now set to 0 (no display) by default.
Setting notification to a higher level should be an explicit operation by a console application.
This commit is contained in:
Yann Collet
2021-09-03 13:44:07 -07:00
parent eab692211e
commit f0fc8cb3e1
4 changed files with 23 additions and 21 deletions
+2 -2
View File
@@ -47,7 +47,7 @@
* Console display
***************************************/
#ifndef LOCALDISPLAYLEVEL
static int g_displayLevel = 2;
static int g_displayLevel = 0;
#endif
#undef DISPLAY
#define DISPLAY(...) \
@@ -735,7 +735,7 @@ ZDICTLIB_API size_t ZDICT_trainFromBuffer_cover(
COVER_map_t activeDmers;
parameters.splitPoint = 1.0;
/* Initialize global data */
g_displayLevel = parameters.zParams.notificationLevel;
g_displayLevel = (int)parameters.zParams.notificationLevel;
/* Checks */
if (!COVER_checkParameters(parameters, dictBufferCapacity)) {
DISPLAYLEVEL(1, "Cover parameters incorrect\n");