From 5b1d75f0bd67175415ed355eb477392d1a0d166f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 25 Nov 2015 17:27:56 +0100 Subject: [PATCH] detect: suppress output --- src/detect-engine-mpm.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 89cc643b90..eb7edcbe54 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -128,10 +128,14 @@ void DetectMpmInitializeAppMpms(DetectEngineCtx *de_ctx) shared = confshared; if (shared == 0) { - SCLogInfo("using unique mpm ctx' for %s", am->name); + if (!(de_ctx->flags & DE_QUIET)) { + SCLogInfo("using unique mpm ctx' for %s", am->name); + } am->sgh_mpm_context = MPM_CTX_FACTORY_UNIQUE_CONTEXT; } else { - SCLogInfo("using shared mpm ctx' for %s", am->name); + if (!(de_ctx->flags & DE_QUIET)) { + SCLogInfo("using shared mpm ctx' for %s", am->name); + } am->sgh_mpm_context = MpmFactoryRegisterMpmCtxProfile(de_ctx, am->name); } @@ -821,16 +825,18 @@ void MpmStoreReportStats(const DetectEngineCtx *de_ctx) } } - uint32_t x; - for (x = 0; x < MPMB_MAX; x++) { - SCLogInfo("Builtin MPM \"%s\": %u", builtin_mpms[x], stats[x]); - } - for (x = 0; x < APP_MPMS_MAX; x++) { - if (appstats[x] == 0) - continue; - const char *name = app_mpms[x].name; - char *direction = app_mpms[x].direction == SIG_FLAG_TOSERVER ? "toserver" : "toclient"; - SCLogInfo("AppLayer MPM \"%s %s\": %u", direction, name, appstats[x]); + if (!(de_ctx->flags & DE_QUIET)) { + uint32_t x; + for (x = 0; x < MPMB_MAX; x++) { + SCLogInfo("Builtin MPM \"%s\": %u", builtin_mpms[x], stats[x]); + } + for (x = 0; x < APP_MPMS_MAX; x++) { + if (appstats[x] == 0) + continue; + const char *name = app_mpms[x].name; + char *direction = app_mpms[x].direction == SIG_FLAG_TOSERVER ? "toserver" : "toclient"; + SCLogInfo("AppLayer MPM \"%s %s\": %u", direction, name, appstats[x]); + } } }