diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index 19d9433664..28f777cbef 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -316,6 +316,7 @@ using documentation::Documentation; namespace std { std::string to_string(openspace::documentation::TestResult::Offense::Reason reason); +std::string to_string(openspace::documentation::TestResult::Warning::Reason reason); } // namespace std diff --git a/openspace.cfg b/openspace.cfg index 277e10f809..5233af0293 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -34,6 +34,7 @@ return { Light = "${FONTS}/Roboto/Roboto-Regular.ttf" }, Logging = { + -- LogLevel = "Trace", LogLevel = "Debug", ImmediateFlush = false, Logs = { diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index 18e644dd65..ee1ee34ee8 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -78,6 +78,13 @@ std::string to_string(openspace::documentation::TestResult::Offense::Reason reas return "Wrong type"; } } + +std::string to_string(openspace::documentation::TestResult::Warning::Reason reason) { + switch (reason) { + case openspace::documentation::TestResult::Warning::Reason::Deprecated: + return "Deprecated"; + } +} } // namespace std @@ -91,6 +98,12 @@ SpecificationError::SpecificationError(TestResult res, std::string component) , result(std::move(res)) { ghoul_assert(!result.success, "Result's success must be false"); + + message += " ("; + for (const TestResult::Offense& o : result.offenses) { + message += o.offender + ','; + } + message.back() = ')'; } DocumentationEntry::DocumentationEntry(std::string k, std::shared_ptr v, diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 86943102a3..2577033c89 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -72,7 +72,7 @@ Documentation ConfigurationManager::Documentation() { ConfigurationManager::PartLogLevel, new StringInListVerifier( // List from logmanager.cpp::levelFromString - { "Debug", "Info", "Warning", "Error", "Fatal", "None" } + { "Trace", "Debug", "Info", "Warning", "Error", "Fatal", "None" } ), "The severity of log messages that will be displayed. Only " "messages of the selected level or higher will be displayed. All " @@ -386,4 +386,4 @@ Documentation ConfigurationManager::Documentation() { }; -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index a163131845..0b06d6f858 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -48,7 +48,7 @@ void ModuleEngine::initialize() { void ModuleEngine::deinitialize() { LDEBUG("Deinitializing modules"); for (auto& m : _modules) { - LDEBUG("Deinitialieing module '" << m->name() << "'"); + LDEBUG("Deinitializing module '" << m->name() << "'"); m->deinitialize(); } _modules.clear(); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 0c48ebdfaa..5b20b44cc9 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -291,6 +292,17 @@ bool OpenSpaceEngine::create(int argc, char** argv, try { _engine->configurationManager().loadFromFile(configurationFilePath); } + catch (const documentation::SpecificationError& e) { + LFATAL("Loading of configuration file '" << configurationFilePath << "' failed"); + for (const documentation::TestResult::Offense& o : e.result.offenses) { + LERRORC(o.offender, std::to_string(o.reason)); + } + for (const documentation::TestResult::Warning& w : e.result.warnings) { + LWARNINGC(w.offender, std::to_string(w.reason)); + } + return false; + + } catch (const ghoul::RuntimeError& e) { LFATAL("Loading of configuration file '" << configurationFilePath << "' failed"); LFATALC(e.component, e.message);