Skip to content

Commit

Permalink
Add LogLevel None support
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin committed Jan 19, 2024
1 parent c8b2337 commit ec784ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ java/data
java/*.dylib
java/*.so
java/*dll

*.log
6 changes: 4 additions & 2 deletions native/src/JavaPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <pdal/XMLSchema.hpp>
#endif

using pdal::LogLevel;
using pdal::LogPtr;
using pdal::MetadataNode;
using pdal::PointId;
Expand Down Expand Up @@ -227,8 +228,9 @@ void PipelineExecutor::setLogStream(std::ostream& strm)

void PipelineExecutor::setLogLevel(int level)
{
if (level < 0 || level > 8)
throw java_error("log level must be between 0 and 8!");
if (level == static_cast<int>(LogLevel::None)) return;
if (level < static_cast<int>(LogLevel::Error) || level > static_cast<int>(LogLevel::Debug5))
throw java_error("log level must be between 0 and 9!");

m_logLevel = static_cast<pdal::LogLevel>(level);
setLogStream(m_logStream);
Expand Down

0 comments on commit ec784ff

Please sign in to comment.