mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 10:29:02 +08:00
Added default logger API
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/fmt_helper.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/details/os.h"
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/console_globals.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/details/os.h"
|
||||
|
@@ -4,10 +4,14 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/file_helper.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
@@ -4,11 +4,15 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/file_helper.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/fmt/fmt.h"
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "base_sink.h"
|
||||
#include "spdlog/details/log_msg.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
|
||||
@@ -25,4 +29,17 @@ using null_sink_mt = null_sink<std::mutex>;
|
||||
using null_sink_st = null_sink<details::null_mutex>;
|
||||
|
||||
} // namespace sinks
|
||||
|
||||
template<typename Factory = default_factory>
|
||||
inline std::shared_ptr<logger> null_logger_mt(const std::string &logger_name)
|
||||
{
|
||||
return Factory::template create<sinks::null_sink_mt>(logger_name);
|
||||
}
|
||||
|
||||
template<typename Factory = default_factory>
|
||||
inline std::shared_ptr<logger> null_logger_st(const std::string &logger_name)
|
||||
{
|
||||
return Factory::template create<sinks::null_sink_st>(logger_name);
|
||||
}
|
||||
|
||||
} // namespace spdlog
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
|
||||
|
@@ -4,11 +4,15 @@
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/file_helper.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/fmt/fmt.h"
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include <cerrno>
|
||||
#include <chrono>
|
||||
|
@@ -5,7 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "spdlog/spdlog.h"
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "spdlog/sinks/wincolor_sink.h"
|
||||
#else
|
||||
|
@@ -5,9 +5,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/details/console_globals.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
|
@@ -5,8 +5,11 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
@@ -5,6 +5,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef SPDLOG_H
|
||||
#error "spdlog.h must be included before this file."
|
||||
#endif
|
||||
|
||||
#include "spdlog/common.h"
|
||||
#include "spdlog/details/console_globals.h"
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
|
Reference in New Issue
Block a user