mirror of https://github.com/gabime/spdlog.git
removed unneeded file
parent
3f37721151
commit
bd2add2da5
@ -1,95 +0,0 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
|
||||||
|
|
||||||
#include <spdlog/spdlog.h>
|
|
||||||
#include <spdlog/common.h>
|
|
||||||
#include <spdlog/pattern_formatter.h>
|
|
||||||
|
|
||||||
namespace spdlog {
|
|
||||||
|
|
||||||
SPDLOG_INLINE void initialize_logger(std::shared_ptr<logger> logger)
|
|
||||||
{
|
|
||||||
details::registry::instance().initialize_logger(std::move(logger));
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE std::shared_ptr<logger> get(const std::string &name)
|
|
||||||
{
|
|
||||||
return details::registry::instance().get(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void set_formatter(std::unique_ptr<spdlog::formatter> formatter)
|
|
||||||
{
|
|
||||||
details::registry::instance().set_formatter(std::move(formatter));
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void set_pattern(std::string pattern, pattern_time_type time_type)
|
|
||||||
{
|
|
||||||
set_formatter(std::unique_ptr<spdlog::formatter>(new pattern_formatter(std::move(pattern), time_type)));
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void set_level(level::level_enum log_level)
|
|
||||||
{
|
|
||||||
details::registry::instance().set_level(log_level);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void flush_on(level::level_enum log_level)
|
|
||||||
{
|
|
||||||
details::registry::instance().flush_on(log_level);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void flush_every(std::chrono::seconds interval)
|
|
||||||
{
|
|
||||||
details::registry::instance().flush_every(interval);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void set_error_handler(void (*handler)(const std::string &msg))
|
|
||||||
{
|
|
||||||
details::registry::instance().set_error_handler(handler);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void register_logger(std::shared_ptr<logger> logger)
|
|
||||||
{
|
|
||||||
details::registry::instance().register_logger(std::move(logger));
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void apply_all(const std::function<void(std::shared_ptr<logger>)> &fun)
|
|
||||||
{
|
|
||||||
details::registry::instance().apply_all(fun);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void drop(const std::string &name)
|
|
||||||
{
|
|
||||||
details::registry::instance().drop(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void drop_all()
|
|
||||||
{
|
|
||||||
details::registry::instance().drop_all();
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void shutdown()
|
|
||||||
{
|
|
||||||
details::registry::instance().shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void set_automatic_registration(bool automatic_registration)
|
|
||||||
{
|
|
||||||
details::registry::instance().set_automatic_registration(automatic_registration);
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE std::shared_ptr<spdlog::logger> default_logger()
|
|
||||||
{
|
|
||||||
return details::registry::instance().default_logger();
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE spdlog::logger *default_logger_raw()
|
|
||||||
{
|
|
||||||
return details::registry::instance().get_default_raw();
|
|
||||||
}
|
|
||||||
|
|
||||||
SPDLOG_INLINE void set_default_logger(std::shared_ptr<spdlog::logger> default_logger)
|
|
||||||
{
|
|
||||||
details::registry::instance().set_default_logger(std::move(default_logger));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace spdlog
|
|
@ -1,13 +1,98 @@
|
|||||||
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
|
||||||
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
#include <spdlog/logger.h>
|
#include <spdlog/spdlog.h>
|
||||||
#include <spdlog/sinks/base_sink.h>
|
#include <spdlog/common.h>
|
||||||
#include <spdlog/details/null_mutex.h>
|
#include <spdlog/pattern_formatter.h>
|
||||||
|
|
||||||
#include <mutex>
|
namespace spdlog {
|
||||||
|
|
||||||
// template instantiate logger constructor with sinks init list
|
SPDLOG_INLINE void initialize_logger(std::shared_ptr<logger> logger)
|
||||||
|
{
|
||||||
|
details::registry::instance().initialize_logger(std::move(logger));
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE std::shared_ptr<logger> get(const std::string &name)
|
||||||
|
{
|
||||||
|
return details::registry::instance().get(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void set_formatter(std::unique_ptr<spdlog::formatter> formatter)
|
||||||
|
{
|
||||||
|
details::registry::instance().set_formatter(std::move(formatter));
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void set_pattern(std::string pattern, pattern_time_type time_type)
|
||||||
|
{
|
||||||
|
set_formatter(std::unique_ptr<spdlog::formatter>(new pattern_formatter(std::move(pattern), time_type)));
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void set_level(level::level_enum log_level)
|
||||||
|
{
|
||||||
|
details::registry::instance().set_level(log_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void flush_on(level::level_enum log_level)
|
||||||
|
{
|
||||||
|
details::registry::instance().flush_on(log_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void flush_every(std::chrono::seconds interval)
|
||||||
|
{
|
||||||
|
details::registry::instance().flush_every(interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void set_error_handler(void (*handler)(const std::string &msg))
|
||||||
|
{
|
||||||
|
details::registry::instance().set_error_handler(handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void register_logger(std::shared_ptr<logger> logger)
|
||||||
|
{
|
||||||
|
details::registry::instance().register_logger(std::move(logger));
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void apply_all(const std::function<void(std::shared_ptr<logger>)> &fun)
|
||||||
|
{
|
||||||
|
details::registry::instance().apply_all(fun);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void drop(const std::string &name)
|
||||||
|
{
|
||||||
|
details::registry::instance().drop(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void drop_all()
|
||||||
|
{
|
||||||
|
details::registry::instance().drop_all();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void shutdown()
|
||||||
|
{
|
||||||
|
details::registry::instance().shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void set_automatic_registration(bool automatic_registration)
|
||||||
|
{
|
||||||
|
details::registry::instance().set_automatic_registration(automatic_registration);
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE std::shared_ptr<spdlog::logger> default_logger()
|
||||||
|
{
|
||||||
|
return details::registry::instance().default_logger();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE spdlog::logger *default_logger_raw()
|
||||||
|
{
|
||||||
|
return details::registry::instance().get_default_raw();
|
||||||
|
}
|
||||||
|
|
||||||
|
SPDLOG_INLINE void set_default_logger(std::shared_ptr<spdlog::logger> default_logger)
|
||||||
|
{
|
||||||
|
details::registry::instance().set_default_logger(std::move(default_logger));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace spdlog
|
||||||
|
|
||||||
|
// template instantiate
|
||||||
template SPDLOG_API spdlog::logger::logger(std::string name, sinks_init_list::iterator begin, sinks_init_list::iterator end);
|
template SPDLOG_API spdlog::logger::logger(std::string name, sinks_init_list::iterator begin, sinks_init_list::iterator end);
|
||||||
template class SPDLOG_API spdlog::sinks::base_sink<std::mutex>;
|
|
||||||
template class SPDLOG_API spdlog::sinks::base_sink<spdlog::details::null_mutex>;
|
|
Loading…
Reference in New Issue