Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions contrib/largeNbDicts/largeNbDicts.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
#define RUN_TIME_DEFAULT_MS 1000
#define BENCH_TIME_DEFAULT_MS (BENCH_TIME_DEFAULT_S * RUN_TIME_DEFAULT_MS)

#define DISPLAY_LEVEL_DEFAULT 3
#ifndef ZSTD_DISPLAY_LEVEL_DEFAULT
# define ZSTD_DISPLAY_LEVEL_DEFAULT 3
#endif

#define BENCH_SIZE_MAX (1200 MB)

Expand All @@ -61,7 +63,7 @@

#define DISPLAY(...) fprintf(stdout, __VA_ARGS__)
#define DISPLAYLEVEL(l, ...) { if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } }
static int g_displayLevel = DISPLAY_LEVEL_DEFAULT; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */
static int g_displayLevel = ZSTD_DISPLAY_LEVEL_DEFAULT; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */


/*--- buffer_t ---*/
Expand Down
7 changes: 7 additions & 0 deletions programs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ There are however other Makefile targets that create different variations of CLI
This can be useful to produce smaller binaries.
A corresponding `Makefile` target using this ability is `zstd-compress`.

- __ZSTD_DISPLAY_LEVEL_DEFAULT__ : Controls the default verbosity level of `zstd` output.
The default value is `2`. Lower values (e.g., `1`) reduce output verbosity,
while higher values (e.g., `3`) increase it.
This allows setting preferred verbosity at compile time,
rather than passing `-q` or `-v` flags at runtime.
Example : `CPPFLAGS="-DZSTD_DISPLAY_LEVEL_DEFAULT=1" make`

- __BACKTRACE__ : `zstd` can display a stack backtrace when execution
generates a runtime exception. By default, this feature may be
degraded/disabled on some platforms unless additional compiler directives are
Expand Down
4 changes: 3 additions & 1 deletion programs/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2401,7 +2401,9 @@ int FIO_compressFilename(FIO_ctx_t* const fCtx, FIO_prefs_t* const prefs, const
cRess_t ress = FIO_createCResources(prefs, dictFileName, UTIL_getFileSize(srcFileName), compressionLevel, comprParams);
int const result = FIO_compressFilename_srcFile(fCtx, prefs, &ress, dstFileName, srcFileName, compressionLevel);

#define DISPLAY_LEVEL_DEFAULT 2
#ifndef ZSTD_DISPLAY_LEVEL_DEFAULT
# define ZSTD_DISPLAY_LEVEL_DEFAULT 2
#endif

FIO_freeCResources(&ress);
return result;
Expand Down
8 changes: 5 additions & 3 deletions programs/zstdcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ static unsigned init_nbWorkers(unsigned defaultNbWorkers);
#define MB *(1 <<20)
#define GB *(1U<<30)

#define DISPLAY_LEVEL_DEFAULT 2
#ifndef ZSTD_DISPLAY_LEVEL_DEFAULT
# define ZSTD_DISPLAY_LEVEL_DEFAULT 2
#endif

static const char* g_defaultDictName = "dictionary";
static const unsigned g_defaultMaxDictSize = 110 KB;
Expand All @@ -104,7 +106,7 @@ typedef enum { cover, fastCover, legacy } dictType;
**************************************/
#undef DISPLAYLEVEL
#define DISPLAYLEVEL(l, ...) { if (g_displayLevel>=l) { DISPLAY(__VA_ARGS__); } }
static int g_displayLevel = DISPLAY_LEVEL_DEFAULT; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */
static int g_displayLevel = ZSTD_DISPLAY_LEVEL_DEFAULT; /* 0 : no display, 1: errors, 2 : + result + interaction + warnings, 3 : + progression, 4 : + information */


/*-************************************
Expand Down Expand Up @@ -660,7 +662,7 @@ static void setMaxCompression(ZSTD_compressionParameters* params)

static void printVersion(void)
{
if (g_displayLevel < DISPLAY_LEVEL_DEFAULT) {
if (g_displayLevel < ZSTD_DISPLAY_LEVEL_DEFAULT) {
DISPLAYOUT("%s\n", ZSTD_VERSION_STRING);
return;
}
Expand Down
Loading