summaryrefslogtreecommitdiff
path: root/wasserstein/include/spdlog/sinks/dist_sink.h
diff options
context:
space:
mode:
authorArnur Nigmetov <nigmetov@tugraz.at>2020-06-01 17:48:28 -0700
committerArnur Nigmetov <nigmetov@tugraz.at>2020-06-01 17:48:28 -0700
commitb40c98e1a73e52dda6ed918e3c732fa5b428ee65 (patch)
tree1bf594273399be33843519d49f4eab9feb90b62a /wasserstein/include/spdlog/sinks/dist_sink.h
parent2c5e6c606ee37cd68bbe9f9915dba99f7677dd87 (diff)
Remove spdlog from Wasserstein code.
Bundled spdlog and fmt are not good for GUDHI integration, and are not really used. Most of debug code simply deleted.
Diffstat (limited to 'wasserstein/include/spdlog/sinks/dist_sink.h')
-rw-r--r--wasserstein/include/spdlog/sinks/dist_sink.h73
1 files changed, 0 insertions, 73 deletions
diff --git a/wasserstein/include/spdlog/sinks/dist_sink.h b/wasserstein/include/spdlog/sinks/dist_sink.h
deleted file mode 100644
index 4d4b6b6..0000000
--- a/wasserstein/include/spdlog/sinks/dist_sink.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Copyright (c) 2015 David Schury, Gabi Melman
-// Distributed under the MIT License (http://opensource.org/licenses/MIT)
-//
-
-#pragma once
-
-#include "spdlog/details/log_msg.h"
-#include "spdlog/details/null_mutex.h"
-#include "spdlog/sinks/base_sink.h"
-#include "spdlog/sinks/sink.h"
-
-#include <algorithm>
-#include <mutex>
-#include <memory>
-#include <vector>
-
-// Distribution sink (mux). Stores a vector of sinks which get called when log is called
-
-namespace spdlog
-{
-namespace sinks
-{
-template<class Mutex>
-class dist_sink: public base_sink<Mutex>
-{
-public:
- explicit dist_sink() :_sinks() {}
- dist_sink(const dist_sink&) = delete;
- dist_sink& operator=(const dist_sink&) = delete;
- virtual ~dist_sink() = default;
-
-protected:
- std::vector<std::shared_ptr<sink>> _sinks;
-
- void _sink_it(const details::log_msg& msg) override
- {
- for (auto &sink : _sinks)
- {
- if( sink->should_log( msg.level))
- {
- sink->log(msg);
- }
- }
- }
-
- void _flush() override
- {
- std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
- for (auto &sink : _sinks)
- sink->flush();
- }
-
-public:
-
-
- void add_sink(std::shared_ptr<sink> sink)
- {
- std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
- _sinks.push_back(sink);
- }
-
- void remove_sink(std::shared_ptr<sink> sink)
- {
- std::lock_guard<Mutex> lock(base_sink<Mutex>::_mutex);
- _sinks.erase(std::remove(_sinks.begin(), _sinks.end(), sink), _sinks.end());
- }
-};
-
-typedef dist_sink<std::mutex> dist_sink_mt;
-typedef dist_sink<details::null_mutex> dist_sink_st;
-}
-}