http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/sinks/null_sink.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/sinks/null_sink.h b/inc/spdlog/sinks/null_sink.h
deleted file mode 100644
index 992b3b7..0000000
--- a/inc/spdlog/sinks/null_sink.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-#pragma once
-#include <mutex>
-#include "./base_sink.h"
-#include "../details/null_mutex.h"
-
-
-namespace spdlog
-{
-namespace sinks
-{
-
-template <class Mutex>
-class null_sink : public base_sink < Mutex >
-{
-protected:
-    void _sink_it(const details::log_msg&) override
-    {}
-
-    void flush() override
-    {}
-
-};
-typedef null_sink<details::null_mutex> null_sink_st;
-typedef null_sink<std::mutex> null_sink_mt;
-
-}
-}
-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/sinks/ostream_sink.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/sinks/ostream_sink.h b/inc/spdlog/sinks/ostream_sink.h
deleted file mode 100644
index f2fe3b2..0000000
--- a/inc/spdlog/sinks/ostream_sink.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-#pragma once
-
-#include <ostream>
-#include <mutex>
-#include <memory>
-
-#include "../details/null_mutex.h"
-#include "./base_sink.h"
-
-namespace spdlog
-{
-namespace sinks
-{
-template<class Mutex>
-class ostream_sink: public base_sink<Mutex>
-{
-public:
-    explicit ostream_sink(std::ostream& os, bool force_flush=false) 
:_ostream(os), _force_flush(force_flush) {}
-    ostream_sink(const ostream_sink&) = delete;
-    ostream_sink& operator=(const ostream_sink&) = delete;
-    virtual ~ostream_sink() = default;
-
-protected:
-    void _sink_it(const details::log_msg& msg) override
-    {
-        _ostream.write(msg.formatted.data(), msg.formatted.size());
-        if (_force_flush)
-            _ostream.flush();
-    }
-
-    void flush() override
-    {
-        _ostream.flush();
-    }
-
-    std::ostream& _ostream;
-    bool _force_flush;
-};
-
-typedef ostream_sink<std::mutex> ostream_sink_mt;
-typedef ostream_sink<details::null_mutex> ostream_sink_st;
-}
-}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/sinks/sink.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/sinks/sink.h b/inc/spdlog/sinks/sink.h
deleted file mode 100644
index 88c423a..0000000
--- a/inc/spdlog/sinks/sink.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-#pragma once
-
-#include "../details/log_msg.h"
-
-namespace spdlog
-{
-namespace sinks
-{
-class sink
-{
-public:
-    virtual ~sink() {}
-    virtual void log(const details::log_msg& msg) = 0;
-    virtual void flush() = 0;
-};
-}
-}
-

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/sinks/stdout_sinks.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/sinks/stdout_sinks.h b/inc/spdlog/sinks/stdout_sinks.h
deleted file mode 100644
index 5ad06c2..0000000
--- a/inc/spdlog/sinks/stdout_sinks.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-#pragma once
-
-#include <iostream>
-#include <mutex>
-#include "./ostream_sink.h"
-#include "../details/null_mutex.h"
-
-namespace spdlog
-{
-namespace sinks
-{
-
-template <class Mutex>
-class stdout_sink : public ostream_sink<Mutex>
-{
-    using MyType = stdout_sink<Mutex>;
-public:
-    stdout_sink() : ostream_sink<Mutex>(std::cout, true) {}
-    static std::shared_ptr<MyType> instance()
-    {
-        static std::shared_ptr<MyType> instance = std::make_shared<MyType>();
-        return instance;
-    }
-};
-
-typedef stdout_sink<details::null_mutex> stdout_sink_st;
-typedef stdout_sink<std::mutex> stdout_sink_mt;
-
-
-template <class Mutex>
-class stderr_sink : public ostream_sink<Mutex>
-{
-    using MyType = stderr_sink<Mutex>;
-public:
-    stderr_sink() : ostream_sink<Mutex>(std::cerr, true) {}
-    static std::shared_ptr<MyType> instance()
-    {
-        static std::shared_ptr<MyType> instance = std::make_shared<MyType>();
-        return instance;
-    }
-
-};
-
-typedef stderr_sink<std::mutex> stderr_sink_mt;
-typedef stderr_sink<details::null_mutex> stderr_sink_st;
-}
-}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/sinks/syslog_sink.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/sinks/syslog_sink.h b/inc/spdlog/sinks/syslog_sink.h
deleted file mode 100644
index 37b6513..0000000
--- a/inc/spdlog/sinks/syslog_sink.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-#pragma once
-
-#ifdef __linux__
-
-#include <array>
-#include <string>
-#include <syslog.h>
-
-#include "./sink.h"
-#include "../common.h"
-#include "../details/log_msg.h"
-
-
-namespace spdlog
-{
-namespace sinks
-{
-/**
- * Sink that write to syslog using the `syscall()` library call.
- *
- * Locking is not needed, as `syslog()` itself is thread-safe.
- */
-class syslog_sink : public sink
-{
-public:
-    //
-    syslog_sink(const std::string& ident = "", int syslog_option=0, int 
syslog_facility=LOG_USER):
-        _ident(ident)
-    {
-        _priorities[static_cast<int>(level::trace)] = LOG_DEBUG;
-        _priorities[static_cast<int>(level::debug)] = LOG_DEBUG;
-        _priorities[static_cast<int>(level::info)] = LOG_INFO;
-        _priorities[static_cast<int>(level::notice)] = LOG_NOTICE;
-        _priorities[static_cast<int>(level::warn)] = LOG_WARNING;
-        _priorities[static_cast<int>(level::err)] = LOG_ERR;
-        _priorities[static_cast<int>(level::critical)] = LOG_CRIT;
-        _priorities[static_cast<int>(level::alert)] = LOG_ALERT;
-        _priorities[static_cast<int>(level::emerg)] = LOG_EMERG;
-        _priorities[static_cast<int>(level::off)] = LOG_INFO;
-
-        //set ident to be program name if empty
-        ::openlog(_ident.empty()? nullptr:_ident.c_str(), syslog_option, 
syslog_facility);
-    }
-    ~syslog_sink()
-    {
-        ::closelog();
-    }
-
-    syslog_sink(const syslog_sink&) = delete;
-    syslog_sink& operator=(const syslog_sink&) = delete;
-
-    void log(const details::log_msg &msg) override
-    {
-        ::syslog(syslog_prio_from_level(msg), "%s", 
msg.formatted.str().c_str());
-    }
-
-    void flush() override
-    {
-    }
-
-
-private:
-    std::array<int, 10> _priorities;
-    //must store the ident because the man says openlog might use the pointer 
as is and not a string copy
-    const std::string _ident;
-
-    //
-    // Simply maps spdlog's log level to syslog priority level.
-    //
-    int syslog_prio_from_level(const details::log_msg &msg) const
-    {
-        return _priorities[static_cast<int>(msg.level)];
-    }
-};
-}
-}
-
-#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/spdlog.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/spdlog.h b/inc/spdlog/spdlog.h
deleted file mode 100644
index 5cec562..0000000
--- a/inc/spdlog/spdlog.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-
-// spdlog main header file.
-//see example.cpp for usage example
-
-#pragma once
-
-#include "tweakme.h"
-#include "common.h"
-#include "logger.h"
-
-namespace spdlog
-{
-// Return an existing logger or nullptr if a logger with such name doesn't 
exist.
-// Examples:
-//
-// spdlog::get("mylog")->info("Hello");
-// auto logger = spdlog::get("mylog");
-// logger.info("This is another message" , x, y, z);
-// logger.info() << "This is another message" << x << y << z;
-std::shared_ptr<logger> get(const std::string& name);
-
-//
-// Set global formatting
-// example: spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v");
-//
-void set_pattern(const std::string& format_string);
-void set_formatter(formatter_ptr f);
-
-//
-// Set global logging level for
-//
-void set_level(level::level_enum log_level);
-
-//
-// Turn on async mode (off by default) and set the queue size for each 
async_logger.
-// effective only for loggers created after this call.
-// queue_size: size of queue (must be power of 2):
-//    Each logger will pre-allocate a dedicated queue with queue_size entries 
upon construction.
-//
-// async_overflow_policy (optional, block_retry by default):
-//    async_overflow_policy::block_retry - if queue is full, block until queue 
has room for the new log entry.
-//    async_overflow_policy::discard_log_msg - never block and discard any new 
messages when queue  overflows.
-//
-// worker_warmup_cb (optional):
-//     callback function that will be called in worker thread upon start (can 
be used to init stuff like thread affinity)
-//
-void set_async_mode(size_t queue_size, const async_overflow_policy 
overflow_policy = async_overflow_policy::block_retry, const 
std::function<void()>& worker_warmup_cb = nullptr, const 
std::chrono::milliseconds& flush_interval_ms = 
std::chrono::milliseconds::zero());
-
-// Turn off async mode
-void set_sync_mode();
-
-//
-// Create and register multi/single threaded rotating file logger
-//
-std::shared_ptr<logger> rotating_logger_mt(const std::string& logger_name, 
const std::string& filename, size_t max_file_size, size_t max_files, bool 
force_flush = false);
-std::shared_ptr<logger> rotating_logger_st(const std::string& logger_name, 
const std::string& filename, size_t max_file_size, size_t max_files, bool 
force_flush = false);
-
-//
-// Create file logger which creates new file on the given time (default in  
midnight):
-//
-std::shared_ptr<logger> daily_logger_mt(const std::string& logger_name, const 
std::string& filename, int hour=0, int minute=0, bool force_flush = false);
-std::shared_ptr<logger> daily_logger_st(const std::string& logger_name, const 
std::string& filename, int hour=0, int minute=0, bool force_flush = false);
-
-
-//
-// Create and register stdout/stderr loggers
-//
-std::shared_ptr<logger> stdout_logger_mt(const std::string& logger_name);
-std::shared_ptr<logger> stdout_logger_st(const std::string& logger_name);
-std::shared_ptr<logger> stderr_logger_mt(const std::string& logger_name);
-std::shared_ptr<logger> stderr_logger_st(const std::string& logger_name);
-
-
-//
-// Create and register a syslog logger
-//
-#ifdef __linux__
-std::shared_ptr<logger> syslog_logger(const std::string& logger_name, const 
std::string& ident = "", int syslog_option = 0);
-#endif
-
-
-// Create and register a logger with multiple sinks
-std::shared_ptr<logger> create(const std::string& logger_name, sinks_init_list 
sinks);
-template<class It>
-std::shared_ptr<logger> create(const std::string& logger_name, const It& 
sinks_begin, const It& sinks_end);
-
-
-// Create and register a logger with templated sink type
-// Example: spdlog::create<daily_file_sink_st>("mylog", "dailylog_filename", 
"txt");
-template <typename Sink, typename... Args>
-std::shared_ptr<spdlog::logger> create(const std::string& logger_name, const 
Args&...);
-
-
-// Register the given logger with the given name
-void register_logger(std::shared_ptr<logger> logger);
-
-// Drop the reference to the given logger
-void drop(const std::string &name);
-
-// Drop all references
-void drop_all();
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// Macros to be display source file & line
-// Trace & Debug can be switched on/off at compile time for zero cost debug 
statements.
-// Uncomment SPDLOG_DEBUG_ON/SPDLOG_TRACE_ON in teakme.h to enable.
-//
-// Example:
-// spdlog::set_level(spdlog::level::debug);
-// SPDLOG_DEBUG(my_logger, "Some debug message {} {}", 1, 3.2);
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef SPDLOG_TRACE_ON
-#define SPDLOG_TRACE(logger, ...) logger->trace(__VA_ARGS__) << " (" << 
__FILE__ << " #" << __LINE__ <<")";
-#else
-#define SPDLOG_TRACE(logger, ...)
-#endif
-
-#ifdef SPDLOG_DEBUG_ON
-#define SPDLOG_DEBUG(logger, ...) logger->debug(__VA_ARGS__)  << " (" << 
__FILE__ << " #" << __LINE__ <<")";
-#else
-#define SPDLOG_DEBUG(logger, ...)
-#endif
-
-
-}
-
-
-#include "details/spdlog_impl.h"

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/inc/spdlog/tweakme.h
----------------------------------------------------------------------
diff --git a/inc/spdlog/tweakme.h b/inc/spdlog/tweakme.h
deleted file mode 100644
index b651658..0000000
--- a/inc/spdlog/tweakme.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*************************************************************************/
-/* spdlog - an extremely fast and easy to use c++11 logging library.     */
-/* Copyright (c) 2014 Gabi Melman.                                       */
-/*                                                                       */
-/* 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.                */
-/*************************************************************************/
-
-
-#pragma once
-
-///////////////////////////////////////////////////////////////////////////////
-// Edit this file to squeeze every last drop of performance out of spdlog.
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Under Linux, the much faster CLOCK_REALTIME_COARSE clock can be used.
-// This clock is less accurate - can be off by dozens of millis - depending on 
the kernel HZ.
-// Uncomment to use it instead of the regular (but slower) clock.
-// #define SPDLOG_CLOCK_COARSE
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Uncomment if date/time logging is not needed.
-// This will prevent spdlog from quering the clock on each log call.
-// #define SPDLOG_NO_DATETIME
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Uncomment if thread id logging is not needed (i.e. no %t in the log 
pattern).
-// This will prevent spdlog from quering the thread id on each log call.
-// #define SPDLOG_NO_THREAD_ID
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Uncomment if logger name logging is not needed.
-// This will prevent spdlog from copying the logger name  on each log call.
-// #define SPDLOG_NO_NAME
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Uncomment to enable the SPDLOG_DEBUG/SPDLOG_TRACE macros.
-// #define SPDLOG_DEBUG_ON
-// #define SPDLOG_TRACE_ON
-///////////////////////////////////////////////////////////////////////////////
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Uncomment to avoid locking in the registry operations (spdlog::get(), 
spdlog::drop() spdlog::register()).
-// Use only if your code never modifes concurrently the registry.
-// Note that upon creating a logger the registry is modified by spdlog..
-// #define SPDLOG_NO_REGISTRY_MUTEX
-///////////////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/include/spdlog/async_logger.h
----------------------------------------------------------------------
diff --git a/include/spdlog/async_logger.h b/include/spdlog/async_logger.h
new file mode 100644
index 0000000..6f07921
--- /dev/null
+++ b/include/spdlog/async_logger.h
@@ -0,0 +1,90 @@
+/*************************************************************************/
+/* spdlog - an extremely fast and easy to use c++11 logging library.     */
+/* Copyright (c) 2014 Gabi Melman.                                       */
+/*                                                                       */
+/* 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.                */
+/*************************************************************************/
+
+#pragma once
+
+// Very fast asynchronous logger (millions of logs per second on an average 
desktop)
+// Uses pre allocated lockfree queue for maximum throughput even under large 
number of threads.
+// Creates a single back thread to pop messages from the queue and log them.
+//
+// Upon each log write the logger:
+//    1. Checks if its log level is enough to log the message
+//    2. Push a new copy of the message to a queue (or block the caller until 
space is available in the queue)
+//    3. will throw spdlog_ex upon log exceptions
+// Upong destruction, logs all remaining messages in the queue before 
destructing..
+
+#include <chrono>
+#include <functional>
+#include "common.h"
+#include "logger.h"
+#include "spdlog.h"
+
+
+namespace spdlog
+{
+
+namespace details
+{
+class async_log_helper;
+}
+
+class async_logger :public logger
+{
+public:
+    template<class It>
+    async_logger(const std::string& name,
+                 const It& begin,
+                 const It& end,
+                 size_t queue_size,
+                 const async_overflow_policy overflow_policy =  
async_overflow_policy::block_retry,
+                 const std::function<void()>& worker_warmup_cb = nullptr,
+                 const std::chrono::milliseconds& flush_interval_ms = 
std::chrono::milliseconds::zero());
+
+    async_logger(const std::string& logger_name,
+                 sinks_init_list sinks,
+                 size_t queue_size,
+                 const async_overflow_policy overflow_policy = 
async_overflow_policy::block_retry,
+                 const std::function<void()>& worker_warmup_cb = nullptr,
+                 const std::chrono::milliseconds& flush_interval_ms = 
std::chrono::milliseconds::zero());
+
+    async_logger(const std::string& logger_name,
+                 sink_ptr single_sink,
+                 size_t queue_size,
+                 const async_overflow_policy overflow_policy =  
async_overflow_policy::block_retry,
+                 const std::function<void()>& worker_warmup_cb = nullptr,
+                 const std::chrono::milliseconds& flush_interval_ms = 
std::chrono::milliseconds::zero());
+
+
+protected:
+    void _log_msg(details::log_msg& msg) override;
+    void _set_formatter(spdlog::formatter_ptr msg_formatter) override;
+    void _set_pattern(const std::string& pattern) override;
+
+private:
+    std::unique_ptr<details::async_log_helper> _async_log_helper;
+};
+}
+
+
+#include "details/async_logger_impl.h"

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/include/spdlog/common.h
----------------------------------------------------------------------
diff --git a/include/spdlog/common.h b/include/spdlog/common.h
new file mode 100644
index 0000000..cde5a9e
--- /dev/null
+++ b/include/spdlog/common.h
@@ -0,0 +1,116 @@
+/*************************************************************************/
+/* spdlog - an extremely fast and easy to use c++11 logging library.     */
+/* Copyright (c) 2014 Gabi Melman.                                       */
+/*                                                                       */
+/* 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.                */
+/*************************************************************************/
+
+#pragma once
+
+#include <string>
+#include <initializer_list>
+#include <chrono>
+#include <memory>
+
+//visual studio does not support noexcept yet
+#ifndef _MSC_VER
+#define SPDLOG_NOEXCEPT noexcept
+#else
+#define SPDLOG_NOEXCEPT throw()
+#endif
+
+
+namespace spdlog
+{
+
+class formatter;
+
+namespace sinks
+{
+class sink;
+}
+
+// Common types across the lib
+using log_clock = std::chrono::system_clock;
+using sink_ptr = std::shared_ptr < sinks::sink > ;
+using sinks_init_list = std::initializer_list < sink_ptr > ;
+using formatter_ptr = std::shared_ptr<spdlog::formatter>;
+
+
+//Log level enum
+namespace level
+{
+typedef enum
+{
+    trace    = 0,
+    debug    = 1,
+    info     = 2,
+    notice   = 3,
+    warn     = 4,
+    err      = 5,
+    critical = 6,
+    alert    = 7,
+    emerg    = 8,
+    off      = 9
+} level_enum;
+
+static const char* level_names[] { "trace", "debug", "info", "notice", 
"warning", "error", "critical", "alert", "emerg", "off"};
+
+static const char* short_level_names[] { "T", "D", "I", "N", "W", "E", "C", 
"A", "M", "O"};
+
+inline const char* to_str(spdlog::level::level_enum l)
+{
+    return level_names[l];
+}
+
+inline const char* to_short_str(spdlog::level::level_enum l)
+{
+    return short_level_names[l];
+}
+} //level
+
+
+//
+// Async overflow policy - block by default.
+//
+enum class async_overflow_policy
+{
+    block_retry, // Block / yield / sleep until message can be enqueued
+    discard_log_msg // Discard the message it enqueue fails
+};
+
+
+//
+// Log exception
+//
+class spdlog_ex : public std::exception
+{
+public:
+    spdlog_ex(const std::string& msg) :_msg(msg) {}
+    const char* what() const SPDLOG_NOEXCEPT override
+    {
+        return _msg.c_str();
+    }
+private:
+    std::string _msg;
+
+};
+
+} //spdlog

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/include/spdlog/details/async_log_helper.h
----------------------------------------------------------------------
diff --git a/include/spdlog/details/async_log_helper.h 
b/include/spdlog/details/async_log_helper.h
new file mode 100644
index 0000000..59c1b2d
--- /dev/null
+++ b/include/spdlog/details/async_log_helper.h
@@ -0,0 +1,326 @@
+/*************************************************************************/
+/* spdlog - an extremely fast and easy to use c++11 logging library.     */
+/* Copyright (c) 2014 Gabi Melman.                                       */
+/*                                                                       */
+/* 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.                */
+/*************************************************************************/
+
+// async log helper :
+// Process logs asynchronously using a back thread.
+//
+// If the internal queue of log messages reaches its max size,
+// then the client call will block until there is more room.
+//
+// If the back thread throws during logging, a spdlog::spdlog_ex exception
+// will be thrown in client's thread when tries to log the next message
+
+#pragma once
+
+#include <chrono>
+#include <thread>
+#include <atomic>
+#include <functional>
+
+#include "../common.h"
+#include "../sinks/sink.h"
+#include "./mpmc_bounded_q.h"
+#include "./log_msg.h"
+#include "./format.h"
+#include "os.h"
+
+
+namespace spdlog
+{
+namespace details
+{
+
+class async_log_helper
+{
+    // Async msg to move to/from the queue
+    // Movable only. should never be copied
+    struct async_msg
+    {
+        std::string logger_name;
+        level::level_enum level;
+        log_clock::time_point time;
+        size_t thread_id;
+        std::string txt;
+
+        async_msg() = default;
+        ~async_msg() = default;
+
+async_msg(async_msg&& other) SPDLOG_NOEXCEPT:
+        logger_name(std::move(other.logger_name)),
+                    level(std::move(other.level)),
+                    time(std::move(other.time)),
+                    txt(std::move(other.txt))
+        {}
+
+        async_msg& operator=(async_msg&& other) SPDLOG_NOEXCEPT
+        {
+            logger_name = std::move(other.logger_name);
+            level = other.level;
+            time = std::move(other.time);
+            thread_id = other.thread_id;
+            txt = std::move(other.txt);
+            return *this;
+        }
+        // never copy or assign. should only be moved..
+        async_msg(const async_msg&) = delete;
+        async_msg& operator=(async_msg& other) = delete;
+
+        // construct from log_msg
+        async_msg(const details::log_msg& m) :
+            logger_name(m.logger_name),
+            level(m.level),
+            time(m.time),
+            thread_id(m.thread_id),
+            txt(m.raw.data(), m.raw.size())
+        {}
+
+
+        // copy into log_msg
+        void fill_log_msg(log_msg &msg)
+        {
+            msg.clear();
+            msg.logger_name = logger_name;
+            msg.level = level;
+            msg.time = time;
+            msg.thread_id = thread_id;
+            msg.raw << txt;
+        }
+    };
+
+public:
+
+    using item_type = async_msg;
+    using q_type = details::mpmc_bounded_queue<item_type>;
+
+    using clock = std::chrono::steady_clock;
+
+
+    async_log_helper(formatter_ptr formatter,
+                     const std::vector<sink_ptr>& sinks,
+                     size_t queue_size,
+                     const async_overflow_policy overflow_policy = 
async_overflow_policy::block_retry,
+                     const std::function<void()>& worker_warmup_cb = nullptr,
+                     const std::chrono::milliseconds& flush_interval_ms = 
std::chrono::milliseconds::zero());
+
+    void log(const details::log_msg& msg);
+
+    // stop logging and join the back thread
+    ~async_log_helper();
+
+    void set_formatter(formatter_ptr);
+
+
+private:
+    formatter_ptr _formatter;
+    std::vector<std::shared_ptr<sinks::sink>> _sinks;
+
+    // queue of messages to log
+    q_type _q;
+
+    // last exception thrown from the worker thread
+    std::shared_ptr<spdlog_ex> _last_workerthread_ex;
+
+    // overflow policy
+    const async_overflow_policy _overflow_policy;
+
+    // worker thread warmup callback - one can set thread priority, affinity, 
etc
+    const std::function<void()> _worker_warmup_cb;
+
+    // auto periodic sink flush parameter
+    const std::chrono::milliseconds _flush_interval_ms;
+
+    // worker thread
+    std::thread _worker_thread;
+
+    // throw last worker thread exception or if worker thread is not active
+    void throw_if_bad_worker();
+
+    // worker thread main loop
+    void worker_loop();
+
+    // pop next message from the queue and process it
+    // return true if a message was available (queue was not empty), will set 
the last_pop to the pop time
+    bool process_next_msg(log_clock::time_point& last_pop, 
log_clock::time_point& last_flush);
+
+    void handle_flush_interval(log_clock::time_point& now, 
log_clock::time_point& last_flush);
+
+    // sleep,yield or return immediatly using the time passed since last 
message as a hint
+    static void sleep_or_yield(const spdlog::log_clock::time_point& now, const 
log_clock::time_point& last_op_time);
+
+
+
+};
+}
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// async_sink class implementation
+///////////////////////////////////////////////////////////////////////////////
+inline spdlog::details::async_log_helper::async_log_helper(formatter_ptr 
formatter, const std::vector<sink_ptr>& sinks, size_t queue_size, const 
async_overflow_policy overflow_policy, const std::function<void()>& 
worker_warmup_cb, const std::chrono::milliseconds& flush_interval_ms):
+    _formatter(formatter),
+    _sinks(sinks),
+    _q(queue_size),
+    _overflow_policy(overflow_policy),
+    _worker_warmup_cb(worker_warmup_cb),
+    _flush_interval_ms(flush_interval_ms),
+    _worker_thread(&async_log_helper::worker_loop, this)
+{}
+
+// Send to the worker thread termination message(level=off)
+// and wait for it to finish gracefully
+inline spdlog::details::async_log_helper::~async_log_helper()
+{
+
+    try
+    {
+        log(log_msg(level::off));
+        _worker_thread.join();
+    }
+    catch (...) //Dont crash if thread not joinable
+    {}
+}
+
+
+//Try to push and block until succeeded
+inline void spdlog::details::async_log_helper::log(const details::log_msg& msg)
+{
+    throw_if_bad_worker();
+    async_msg new_msg(msg);
+    if (!_q.enqueue(std::move(new_msg)) && _overflow_policy != 
async_overflow_policy::discard_log_msg)
+    {
+        auto last_op_time = details::os::now();
+        auto now = last_op_time;
+        do
+        {
+            now = details::os::now();
+            sleep_or_yield(now, last_op_time);
+        }
+        while (!_q.enqueue(std::move(new_msg)));
+    }
+
+}
+
+inline void spdlog::details::async_log_helper::worker_loop()
+{
+    try
+    {
+        if (_worker_warmup_cb) _worker_warmup_cb();
+        auto last_pop = details::os::now();
+        auto last_flush = last_pop;
+        while(process_next_msg(last_pop, last_flush));
+    }
+    catch (const std::exception& ex)
+    {
+        _last_workerthread_ex = 
std::make_shared<spdlog_ex>(std::string("async_logger worker thread exception: 
") + ex.what());
+    }
+    catch (...)
+    {
+        _last_workerthread_ex = std::make_shared<spdlog_ex>("async_logger 
worker thread exception");
+    }
+}
+
+// process next message in the queue
+// return true if this thread should still be active (no msg with level::off 
was received)
+inline bool 
spdlog::details::async_log_helper::process_next_msg(log_clock::time_point& 
last_pop, log_clock::time_point& last_flush)
+{
+
+    async_msg incoming_async_msg;
+    log_msg incoming_log_msg;
+
+    if (_q.dequeue(incoming_async_msg))
+    {
+        last_pop = details::os::now();
+
+        if(incoming_async_msg.level == level::off)
+            return false;
+
+        incoming_async_msg.fill_log_msg(incoming_log_msg);
+        _formatter->format(incoming_log_msg);
+        for (auto &s : _sinks)
+            s->log(incoming_log_msg);
+    }
+    else //empty queue
+    {
+        auto now = details::os::now();
+        handle_flush_interval(now, last_flush);
+        sleep_or_yield(now, last_pop);
+    }
+    return true;
+}
+
+inline void 
spdlog::details::async_log_helper::handle_flush_interval(log_clock::time_point& 
now, log_clock::time_point& last_flush)
+{
+    if (_flush_interval_ms != std::chrono::milliseconds::zero() && now - 
last_flush >= _flush_interval_ms)
+    {
+        for (auto &s : _sinks)
+            s->flush();
+        now = last_flush = details::os::now();
+    }
+}
+inline void spdlog::details::async_log_helper::set_formatter(formatter_ptr 
msg_formatter)
+{
+    _formatter = msg_formatter;
+}
+
+
+// sleep,yield or return immediatly using the time passed since last message 
as a hint
+inline void spdlog::details::async_log_helper::sleep_or_yield(const 
spdlog::log_clock::time_point& now, const spdlog::log_clock::time_point& 
last_op_time)
+{
+    using std::chrono::milliseconds;
+    using namespace std::this_thread;
+
+    auto time_since_op = now - last_op_time;
+
+    // spin upto 1 ms
+    if (time_since_op <= milliseconds(1))
+        return;
+
+    // yield upto 10ms
+    if (time_since_op <= milliseconds(10))
+        return yield();
+
+
+    // sleep for half of duration since last op
+    if (time_since_op <= milliseconds(100))
+        return sleep_for(time_since_op / 2);
+
+    return sleep_for(milliseconds(100));
+}
+
+// throw if the worker thread threw an exception or not active
+inline void spdlog::details::async_log_helper::throw_if_bad_worker()
+{
+    if (_last_workerthread_ex)
+    {
+        auto ex = std::move(_last_workerthread_ex);
+        throw *ex;
+    }
+}
+
+
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/include/spdlog/details/async_logger_impl.h
----------------------------------------------------------------------
diff --git a/include/spdlog/details/async_logger_impl.h 
b/include/spdlog/details/async_logger_impl.h
new file mode 100644
index 0000000..f60407e
--- /dev/null
+++ b/include/spdlog/details/async_logger_impl.h
@@ -0,0 +1,82 @@
+/*************************************************************************/
+/* spdlog - an extremely fast and easy to use c++11 logging library.     */
+/* Copyright (c) 2014 Gabi Melman.                                       */
+/*                                                                       */
+/* 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.                */
+/*************************************************************************/
+
+#pragma once
+
+
+#include "./async_log_helper.h"
+
+//
+// Async Logger implementation
+// Use single async_sink (queue) to perform the logging in a worker thread
+//
+
+
+template<class It>
+inline spdlog::async_logger::async_logger(const std::string& logger_name,
+        const It& begin,
+        const It& end,
+        size_t queue_size,
+        const  async_overflow_policy overflow_policy,
+        const std::function<void()>& worker_warmup_cb,
+        const std::chrono::milliseconds& flush_interval_ms) :
+    logger(logger_name, begin, end),
+    _async_log_helper(new details::async_log_helper(_formatter, _sinks, 
queue_size, overflow_policy, worker_warmup_cb, flush_interval_ms))
+{
+}
+
+inline spdlog::async_logger::async_logger(const std::string& logger_name,
+        sinks_init_list sinks,
+        size_t queue_size,
+        const  async_overflow_policy overflow_policy,
+        const std::function<void()>& worker_warmup_cb,
+        const std::chrono::milliseconds& flush_interval_ms) :
+    async_logger(logger_name, sinks.begin(), sinks.end(), queue_size, 
overflow_policy, worker_warmup_cb, flush_interval_ms) {}
+
+inline spdlog::async_logger::async_logger(const std::string& logger_name,
+        sink_ptr single_sink,
+        size_t queue_size,
+        const  async_overflow_policy overflow_policy,
+        const std::function<void()>& worker_warmup_cb,
+        const std::chrono::milliseconds& flush_interval_ms) :
+    async_logger(logger_name, { single_sink }, queue_size, overflow_policy, 
worker_warmup_cb, flush_interval_ms) {}
+
+
+inline void spdlog::async_logger::_set_formatter(spdlog::formatter_ptr 
msg_formatter)
+{
+    _formatter = msg_formatter;
+    _async_log_helper->set_formatter(_formatter);
+}
+
+inline void spdlog::async_logger::_set_pattern(const std::string& pattern)
+{
+    _formatter = std::make_shared<pattern_formatter>(pattern);
+    _async_log_helper->set_formatter(_formatter);
+}
+
+
+inline void spdlog::async_logger::_log_msg(details::log_msg& msg)
+{
+    _async_log_helper->log(msg);
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/b02af540/include/spdlog/details/file_helper.h
----------------------------------------------------------------------
diff --git a/include/spdlog/details/file_helper.h 
b/include/spdlog/details/file_helper.h
new file mode 100644
index 0000000..8e1f600
--- /dev/null
+++ b/include/spdlog/details/file_helper.h
@@ -0,0 +1,144 @@
+/*************************************************************************/
+/* spdlog - an extremely fast and easy to use c++11 logging library.     */
+/* Copyright (c) 2014 Gabi Melman.                                       */
+/*                                                                       */
+/* 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.                */
+/*************************************************************************/
+
+#pragma once
+
+// Helper class for file sink
+// When failing to open a file, retry several times(5) with small delay 
between the tries(10 ms)
+// Can be set to auto flush on every line
+// Throw spdlog_ex exception on errors
+
+#include <string>
+#include <thread>
+#include <chrono>
+#include "os.h"
+
+
+
+
+namespace spdlog
+{
+namespace details
+{
+
+class file_helper
+{
+public:
+    const int open_tries = 5;
+    const int open_interval = 10;
+
+    explicit file_helper(bool force_flush):
+        _fd(nullptr),
+        _force_flush(force_flush)
+    {}
+
+    file_helper(const file_helper&) = delete;
+    file_helper& operator=(const file_helper&) = delete;
+
+    ~file_helper()
+    {
+        close();
+    }
+
+
+    void open(const std::string& fname, bool truncate=false)
+    {
+
+        close();
+        const char* mode = truncate ? "wb" : "ab";
+        _filename = fname;
+        for (int tries = 0; tries < open_tries; ++tries)
+        {
+            if(!os::fopen_s(&_fd, fname, mode))
+                return;
+
+            
std::this_thread::sleep_for(std::chrono::milliseconds(open_interval));
+        }
+
+        throw spdlog_ex("Failed opening file " + fname + " for writing");
+    }
+
+    void reopen(bool truncate)
+    {
+        if(_filename.empty())
+            throw spdlog_ex("Failed re opening file - was not opened before");
+        open(_filename, truncate);
+
+    }
+
+    void flush() {
+        std::fflush(_fd);
+    }
+
+    void close()
+    {
+        if (_fd)
+        {
+            std::fclose(_fd);
+            _fd = nullptr;
+        }
+    }
+
+    void write(const log_msg& msg)
+    {
+
+        size_t size = msg.formatted.size();
+        auto data = msg.formatted.data();
+        if(std::fwrite(data, 1, size, _fd) != size)
+            throw spdlog_ex("Failed writing to file " + _filename);
+
+        if(_force_flush)
+            std::fflush(_fd);
+
+    }
+
+    const std::string& filename() const
+    {
+        return _filename;
+    }
+
+    static bool file_exists(const std::string& name)
+    {
+        FILE* file;
+        if (!os::fopen_s(&file, name.c_str(), "r"))
+        {
+            fclose(file);
+            return true;
+        }
+        else
+        {
+            return false;
+        }
+    }
+
+private:
+    FILE* _fd;
+    std::string _filename;
+    bool _force_flush;
+
+
+};
+}
+}
+

Reply via email to