Skip to content

Commit

Permalink
Replace printError() with log().
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jan 12, 2016
1 parent 4491003 commit 8498d71
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions filters/stats/StatsFilter.cpp
Expand Up @@ -38,8 +38,10 @@

#include <pdal/pdal_export.hpp>
#include <pdal/Options.hpp>
/**
#include <pdal/PDALUtils.hpp>
#include <pdal/util/Utils.hpp>
**/

namespace pdal
{
Expand Down Expand Up @@ -120,8 +122,8 @@ void StatsFilter::processOptions(const Options& options)
void StatsFilter::prepared(PointTableRef table)
{
PointLayoutPtr layout(table.layout());

std::unordered_map<std::string, Summary::EnumType> dims;
std::ostream& out = log()->get(LogLevel::Warning);

// Add dimensions to the list.
if (m_dimNames.empty())
Expand All @@ -134,12 +136,8 @@ void StatsFilter::prepared(PointTableRef table)
for (auto& s : m_dimNames)
{
if (layout->findDim(s) == Dimension::Id::Unknown)
{
std::ostringstream out;
out << "Dimension '" << s << "' listed in --dimensions option "
"does not exist. Ignoring.";
Utils::printError(out.str());
}
out << "Dimension '" << s << "' listed in --dimensions "
"option does not exist. Ignoring." << std::endl;
else
dims[s] = Summary::NoEnum;
}
Expand All @@ -149,12 +147,8 @@ void StatsFilter::prepared(PointTableRef table)
for (auto& s : m_enums)
{
if (dims.find(s) == dims.end())
{
std::ostringstream out;
out << "Dimension '" << s << "' listed in --enumerate option "
"does not exist. Ignoring.";
Utils::printError(out.str());
}
"does not exist. Ignoring." << std::endl;
else
dims[s] = Summary::Enumerate;
}
Expand All @@ -163,12 +157,8 @@ void StatsFilter::prepared(PointTableRef table)
for (auto& s : m_counts)
{
if (dims.find(s) == dims.end())
{
std::ostringstream out;
out << "Dimension '" << s << "' listed in --count option "
"does not exist. Ignoring.";
Utils::printError(out.str());
}
"does not exist. Ignoring." << std::endl;
else
dims[s] = Summary::Count;
}
Expand Down

0 comments on commit 8498d71

Please sign in to comment.