[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-08-03 Thread GitBox


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



##
File path: libminifi/src/core/logging/LoggerConfiguration.cpp
##
@@ -294,26 +295,27 @@ std::shared_ptr 
LoggerConfiguration::get_logger(std::shared_ptr<
   return spdlog::get(name);
 }
 
-std::shared_ptr LoggerConfiguration::create_syslog_sink() 
{
+spdlog::sink_ptr LoggerConfiguration::create_syslog_sink() {
 #ifdef WIN32
   return std::make_shared("ApacheNiFiMiNiFi");
 #else
-  return std::make_shared("ApacheNiFiMiNiFi");
+  return 
std::dynamic_pointer_cast(spdlog::syslog_logger_mt("ApacheNiFiMiNiFi",
 0, LOG_USER, false));
 #endif
 }
 
-std::shared_ptr 
LoggerConfiguration::create_fallback_sink() {
+spdlog::sink_ptr LoggerConfiguration::create_fallback_sink() {
   if (utils::Environment::isRunningAsService()) {
 return LoggerConfiguration::create_syslog_sink();
   } else {
-return spdlog::sinks::stderr_sink_mt::instance();
+return 
std::dynamic_pointer_cast(std::make_shared());
   }
 }
 
 std::shared_ptr 
LoggerConfiguration::create_default_root() {
   std::shared_ptr result = 
std::make_shared();
   result->sinks = std::vector>();
-  result->sinks.push_back(spdlog::sinks::stderr_sink_mt::instance());
+  auto default_sink = std::make_shared();
+  result->sinks.emplace_back(std::move(default_sink));

Review comment:
   That is a valid and useful refactor. I did not check the context on 
doing the update.





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




[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-08-03 Thread GitBox


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



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

Review comment:
   I tried doing the suggested change before updating the PR, but 
unfortunately it does not compile.





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




[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-07-17 Thread GitBox


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



##
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:
   Ah, I have seen those lines, but I do not know why we have them. At no 
point did spdlog have them listed in its `LICENSE` ([[see 
here]](https://github.com/gabime/spdlog/commits/v1.x/LICENSE)), but their names 
were present in the codebase as copyright holders. For some reason [[Aldrin 
asked us]](https://github.com/apache/nifi-minifi-cpp/pull/55) to provide these 
in our notice as well.
   
   I updated the lines so that they are in correspondence with the current 
copyright notices in the spdlog files.





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




[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-07-17 Thread GitBox


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



##
File path: NOTICE
##
@@ -44,11 +44,13 @@ Amazon Technologies, Inc (http://www.amazon.com/).
 THIRD PARTY COMPONENTS
 **
 This software includes third party software subject to the following 
copyrights:
-- XML parsing and utility functions from TinyXml2 - Lee Thomason.
-- JSON parsing and utility functions from JsonCpp - Copyright (c) 2007-2010 
Baptiste Lepilleur.
+- Very fast, header-only/compiled, C++ logging library from spdlog - Copyright 
(c) 2016 Gabi Melman
+- An open-source formatting library for C++ from fmt - Copyright (c) 2012 - 
present, Victor Zverovich
+- XML parsing and utility functions from TinyXml2 - Lee Thomason
+- JSON parsing and utility functions from JsonCpp - Copyright (c) 2007-2010 
Baptiste Lepilleur
 - OpenSSL build files for cmake used for Android Builds - Copyright (C) 
2007-2012 LuaDist and Copyright (C) 2013 Brian Sidebotham
 - Android tool chain cmake build files - Copyright (c) 2010-2011, Ethan Rublee 
and Copyright (c) 2011-2014, Andrey Kamaev
-- gsl-lite - Copyright (c) 2015 Martin Moene and Copyright (c) 2015 Microsoft 
Corporation. All rights reserved.
+- gsl-lite - Copyright (c) 2015 Martin Moene and Copyright (c) 2015 Microsoft 
Corporation. All rights reserved

Review comment:
   Ah, I did not know that these notices are literal. Will add it back 
again :)





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




[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-07-17 Thread GitBox


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



##
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:
   Ah, I have seen those lines, but I do not know where they are coming 
from. At no point did spdlog have them listed in its `LICENSE` ([[see 
here]](https://github.com/gabime/spdlog/commits/v1.x/LICENSE)), but their names 
were present in the codebase as copyright holders. For some reason [[Aldrin 
asked us]](https://github.com/apache/nifi-minifi-cpp/pull/55) to provide these 
in our notice as well.
   
   I updated the lines so that they are in correspondence with the current 
copyright notices in the spdlog files.





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




[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-07-17 Thread GitBox


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



##
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 am not exactly sure how the first comments first bullet differs from 
the second comment. Updated the `NOTICE` and added a section for fmt in this 
`LICENSE` file.





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




[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #837: MINIFICPP-1121 - Upgrade spdlog to version 1.7.0

2020-07-16 Thread GitBox


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



##
File path: libminifi/include/core/PropertyValidation.h
##
@@ -202,7 +202,7 @@ class UnsignedIntValidator : public PropertyValidator {
 
 class LongValidator : public PropertyValidator {
  public:
-  explicit LongValidator(const std::string , int64_t min = 
(std::numeric_limits::min)(), int64_t max = 
(std::numeric_limits::max)())
+  explicit LongValidator(const std::string , int64_t min = 
std::numeric_limits::min(), int64_t max = 
(std::numeric_limits::max)())

Review comment:
   Good catch, removed.

##
File path: libminifi/src/utils/file/FileUtils.cpp
##
@@ -40,7 +40,7 @@ uint64_t FileUtils::computeChecksum(const std::string 
_name, uint64_t up_to
 
   while (stream && remaining_bytes_to_be_read > 0) {
 // () around std::min are needed because Windows.h defines min (and max) 
as a macro

Review comment:
   Good catch, removed.





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