From: Philippe Antoine Date: Fri, 12 Jul 2019 09:17:59 +0000 (+0200) Subject: config: use logging instead of stderr X-Git-Tag: suricata-5.0.1~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1e41632c1aa2e631738474f9b78f9b761b107bd;p=thirdparty%2Fsuricata.git config: use logging instead of stderr --- 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; } }