Coded location logging

This commit is contained in:
Dan Paulat 2022-01-26 14:57:25 -06:00
parent db4f37a37d
commit 7d503ec506
4 changed files with 101 additions and 0 deletions

View file

@ -114,6 +114,11 @@ bool CodedLocation::Parse(const StringRange& lines, const std::string& wfo)
{
if (token->size() != 8)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_
<< "Invalid National Center LAT...LON format: \"" << *token
<< "\"";
dataValid = false;
break;
}
@ -137,6 +142,27 @@ bool CodedLocation::Parse(const StringRange& lines, const std::string& wfo)
}
}
}
else
{
if (tokenList.empty())
{
BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "LAT...LON not found";
}
else
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_
<< "Malformed LAT...LON tokens: (0: " << tokenList.at(0)
<< ", size: " << tokenList.size() << ")";
for (const auto& token : tokenList)
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << token;
}
}
dataValid = false;
}
if (dataValid)
{

View file

@ -175,6 +175,28 @@ bool CodedTimeMotionLocation::Parse(const StringRange& lines,
}
}
}
else
{
if (tokenList.empty())
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "TIME...MOT...LOC not found";
}
else
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_
<< "Malformed TIME...MOT...LOC tokens: (0: " << tokenList.at(0)
<< ", size: " << tokenList.size() << ")";
for (const auto& token : tokenList)
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << token;
}
}
dataValid = false;
}
return dataValid;
}