From 7ac4bced80e09220f5b1c6c4f8d2ea6223551d6e Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 10 Feb 2013 21:48:03 -0800 Subject: [PATCH] Warn if configuration has wrong number of lines when single expected. --- src/cpp/ripple/ParseSection.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cpp/ripple/ParseSection.cpp b/src/cpp/ripple/ParseSection.cpp index 839d3c85ee..12bdded4b7 100644 --- a/src/cpp/ripple/ParseSection.cpp +++ b/src/cpp/ripple/ParseSection.cpp @@ -1,4 +1,5 @@ #include "ParseSection.h" +#include "Log.h" #include "utils.h" #include @@ -7,6 +8,8 @@ #define SECTION_DEFAULT_NAME "" +SETUP_LOG(); + section ParseSection(const std::string& strInput, const bool bTrim) { std::string strData(strInput); @@ -113,6 +116,12 @@ bool sectionSingleB(section& secSource, const std::string& strSection, std::stri { strValue = (*pmtEntries)[0]; } + else if (pmtEntries) + { + cLog(lsWARNING) << boost::str(boost::format("Section [%s]: requires 1 line not %d lines.") + % strSection + % pmtEntries->size()); + } return bSingle; }