Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10385 closed Bugs (wontfix)

init_from_stream ignores errors in config file/stream

Reported by: Antony Polukhin Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.56.0 Severity: Problem
Keywords: Cc:

Description

Some typos are ignored by the boost::log::init_from_stream function.

For example config file with incorrectly spelled Sinks.:

[Sink.ImportantSink]

will be accepted and the whole section will be silently ignored.

Change History (3)

comment:1 by Andrey Semashev, 8 years ago

Resolution: wontfix
Status: newclosed

Technically, this is a correct config with section Sink and a nested section ImportantSink. The library simply doesn't use that section, but that doesn't make the config incorrect. I don't think that issuing errors upon any unrecognized sections or parameters is a good idea because they can potentially be used by the user.

comment:2 by Antony Polukhin, 8 years ago

How about providing an option for forcing strict/non-strict config file parsing, like it is done in Boost.ProgramOptions.

Having it set so "strict" by default will help beginners to find errors in their config files, while advanced users still will be able to put all the configs in one file.

comment:3 by Andrey Semashev, 8 years ago

Having an optional strict mode might be useful, although it may affect public interfaces for extending the library. I'll have to think about it. In any case, I don't think it should be the default because the current behavior is different.

Note: See TracTickets for help on using tickets.