From c1e41632c1aa2e631738474f9b78f9b761b107bd Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Fri, 12 Jul 2019 11:17:59 +0200 Subject: [PATCH] config: use logging instead of stderr --- src/conf-yaml-loader.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf-yaml-loader.c b/src/conf-yaml-loader.c index 7599c1f1db..1f27e92109 100644 --- a/src/conf-yaml-loader.c +++ b/src/conf-yaml-loader.c @@ -195,15 +195,15 @@ ConfYamlParse(yaml_parser_t *parser, ConfNode *parent, int inseq) yaml_version_directive_t *ver = event.data.document_start.version_directive; if (ver == NULL) { - fprintf(stderr, "ERROR: Invalid configuration file.\n\n"); - fprintf(stderr, "The configuration file must begin with the following two lines:\n\n"); - fprintf(stderr, "%%YAML 1.1\n---\n\n"); + SCLogError(SC_ERR_CONF_YAML_ERROR, "ERROR: Invalid configuration file."); + SCLogError(SC_ERR_CONF_YAML_ERROR, + "The configuration file must begin with the following two lines: %%YAML 1.1 and ---"); goto fail; } int major = ver->major; int minor = ver->minor; if (!(major == YAML_VERSION_MAJOR && minor == YAML_VERSION_MINOR)) { - fprintf(stderr, "ERROR: Invalid YAML version. Must be 1.1\n"); + SCLogError(SC_ERR_CONF_YAML_ERROR, "ERROR: Invalid YAML version. Must be 1.1"); goto fail; } } -- 2.47.2