From ec784ff0d5387a35d34d697943f7b9bba45467a2 Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Fri, 19 Jan 2024 18:14:39 -0500 Subject: [PATCH] Add LogLevel None support --- .gitignore | 2 ++ native/src/JavaPipeline.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2dd4de5..3c35b94 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,5 @@ java/data java/*.dylib java/*.so java/*dll + +*.log diff --git a/native/src/JavaPipeline.cpp b/native/src/JavaPipeline.cpp index f143bcd..890ca66 100644 --- a/native/src/JavaPipeline.cpp +++ b/native/src/JavaPipeline.cpp @@ -36,6 +36,7 @@ #include #endif +using pdal::LogLevel; using pdal::LogPtr; using pdal::MetadataNode; using pdal::PointId; @@ -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(LogLevel::None)) return; + if (level < static_cast(LogLevel::Error) || level > static_cast(LogLevel::Debug5)) + throw java_error("log level must be between 0 and 9!"); m_logLevel = static_cast(level); setLogStream(m_logStream);