szaszm commented on a change in pull request #837:
URL: https://github.com/apache/nifi-minifi-cpp/pull/837#discussion_r462925415



##########
File path: libminifi/src/core/logging/LoggerConfiguration.cpp
##########
@@ -298,22 +299,23 @@ std::shared_ptr<spdlog::sinks::sink> 
LoggerConfiguration::create_syslog_sink() {
 #ifdef WIN32
   return std::make_shared<internal::windowseventlog_sink>("ApacheNiFiMiNiFi");
 #else
-  return std::make_shared<spdlog::sinks::syslog_sink>("ApacheNiFiMiNiFi");
+  return 
std::dynamic_pointer_cast<spdlog::sinks::sink>(spdlog::syslog_logger_mt("ApacheNiFiMiNiFi",
 0, LOG_USER, false));

Review comment:
       `spdlog::sink_ptr` seems to be the type to be used for type-erasing sink 
types, so I recommend changing the return type to that instead of casting. 
Applies to all create_* functions.
   
   See the example at:
   
https://github.com/gabime/spdlog/wiki/2.-Creating-loggers#creating-loggers-with-multiple-sinks

##########
File path: libminifi/test/TestBase.cpp
##########
@@ -21,7 +21,8 @@
 #include "spdlog/spdlog.h"
 
 void LogTestController::setLevel(const std::string name, 
spdlog::level::level_enum level) {
-  logger_->log_info("Setting log level for %s to %s", name, 
spdlog::level::to_str(level));
+  const fmt::basic_string_view<char> 
levelView(spdlog::level::to_string_view(level));

Review comment:
       Use `auto` to be forward-compatible with `std::string_view` should the 
spdlog return type ever change.
   
   
https://github.com/gabime/spdlog/blob/eb23d505f86f01d61b10ef0899f2f7b2b377ec6d/include/spdlog/fmt/bundled/core.h#L190

##########
File path: LICENSE
##########
@@ -258,23 +258,27 @@ This product bundles 'spdlog' which is available under an 
MIT license.
        
        Copyright (c) 2016 spdlog.
        
-       Permission is hereby granted, free of charge, to any person obtaining a 
copy
-       of this software and associated documentation files (the "Software"), 
to deal
-       in the Software without restriction, including without limitation the 
rights
-       to use, copy, modify, merge, publish, distribute, sublicense, and/or 
sell
-       copies of the Software, and to permit persons to whom the Software is
-       furnished to do so, subject to the following conditions:
-
-       The above copyright notice and this permission notice shall be included 
in
-       all copies or substantial portions of the Software.
-
-       THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
OR
-       IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-       FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT 
SHALL THE
-       AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-       LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
-       OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
IN
-       THE SOFTWARE.
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in
+  all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+  THE SOFTWARE.
+
+  -- NOTE: Third party dependency used by this software --
+  This software depends on the fmt lib (MIT License),
+  and users must comply to its license: 
https://github.com/fmtlib/fmt/blob/master/LICENSE.rst

Review comment:
       I meant that we should keep the copyright notices, I take back my 
original first bullet.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to