]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
config: use logging instead of stderr
authorPhilippe Antoine <contact@catenacyber.fr>
Fri, 12 Jul 2019 09:17:59 +0000 (11:17 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 17 Oct 2019 09:29:25 +0000 (11:29 +0200)
src/conf-yaml-loader.c

index 7599c1f1dbeb9089ee550405f179e20c406143c7..1f27e9210981387227202abddff52127d1781305 100644 (file)
@@ -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;
             }
         }