From d5c11f7abdd2fb15331179b17128c88703e91f1f Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 5 Dec 2009 13:52:49 +0100 Subject: [PATCH] Make engine initialization a bit more quiet. --- src/detect-flowbits.c | 5 ++++- src/detect-ipproto.c | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index fa5a58dc06..6296be32b1 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -21,6 +21,7 @@ #include "flow-bit.h" #include "util-var-name.h" #include "util-unittest.h" +#include "util-debug.h" #define PARSE_REGEX "([a-z]+)(?:,(.*))?" static pcre *parse_regex; @@ -212,7 +213,9 @@ int DetectFlowbitSetup (DetectEngineCtx *de_ctx, Signature *s, SigMatch *m, char cd->idx = 0; } cd->cmd = fb_cmd; - printf("DetectFlowbitSetup: idx %" PRIu32 ", cmd %s, name %s\n", cd->idx, fb_cmd_str, fb_name ? fb_name : "(null)"); + + SCLogDebug("idx %" PRIu32 ", cmd %s, name %s", + cd->idx, fb_cmd_str, fb_name ? fb_name : "(null)"); /* Okay so far so good, lets get this into a SigMatch * and put it in the Signature. */ diff --git a/src/detect-ipproto.c b/src/detect-ipproto.c index 9948c9091f..31a3756465 100644 --- a/src/detect-ipproto.c +++ b/src/detect-ipproto.c @@ -24,6 +24,8 @@ #include "util-byte.h" #include "util-unittest.h" +#include "util-debug.h" + /** * \brief Regex for parsing our options */ @@ -202,11 +204,13 @@ static int DetectIPProtoSetup(DetectEngineCtx *de_ctx, Signature *s, break; } #if DEBUG - printf("op='%c' bits=\"", data->op); - for (i = 0; i < (256/8); i++) { - printf("%02x", s->proto.proto[i]); + if (SCLogDebugEnabled()) { + printf("op='%c' bits=\"", data->op); + for (i = 0; i < (256/8); i++) { + printf("%02x", s->proto.proto[i]); + } + printf("\"\n"); } - printf("\"\n"); #endif ret = 0;