Hi Laban

I'm trying to use the openvas_library logging interface in the manager.
I've found some issues:

 - In openvas_logging.c load_log_configuration and openvas_log_func
   both call g_error.  The g_error doc says this is only for programming
   errors.

           A convenience function/macro to log an error message. Error messages 
are always
           fatal, resulting in a call to abort() to terminate the application. 
This
           function will result in a core dump; don't use it for errors you 
expect. Using
           this function indicates a bug in your program, i.e. an assertion 
failure.

   Maybe this is the correct behaviour for openvas_log_func but I think at
   least load_log_configuration should signal the error some other way,
   perhaps just by returning NULL.

 - Quotes around a "file" element in a config section, like in the CR, are
   treated as part of the file name, so

           file="/var/log/openvas.log"

   fails to find /var/log/openvas.log even though the file is there.

 - I think the "level" element would be better as a string, "warning",
   "critical", etc.  What do you think?  It should be fairly simple to do.

 - Do [*] config sections work at all?  I only see openvas_log_func
   comparing directly with the config header strings.

 - The formatting in the code is quite mixed.  Running something like

          indent -l 80 openvas_logging.c

   will convert it all to the GNU standard.  Variable naming is also pretty
   mixed, "openvaslogconfiglist" for some, "log_separator" for others.
   Separating words in variable names with underscores makes the code much
   easier to read.

Thanks
Matt
--
Intevation GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 18998
Geschäftsführer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
_______________________________________________
Openvas-devel mailing list
Openvas-devel@wald.intevation.org
http://lists.wald.intevation.org/mailman/listinfo/openvas-devel

Reply via email to