diff --git a/example/example.cpp b/example/example.cpp index 66e55aae..6686ca95 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -14,8 +14,8 @@ #include "spdlog/color_logger.h" -#include "spdlog/stdout_logger.h" -#include "spdlog/async.h" +//#include "spdlog/stdout_logger.h" +//#include "spdlog/async.h" #include "spdlog/spdlog.h" #include @@ -36,10 +36,10 @@ int main(int, char *[]) { // Console logger with color - spd::init_thread_pool(8192, 3); + //spd::init_thread_pool(8192, 3); auto console1 = spdlog::stdout_color_mt("console111"); - auto console2 = spdlog::stdout_logger_mt("console2"); + auto console2 = spdlog::stdout_color_mt<>("console2"); //auto console3 = spdlog::stdout_color_mt("console3"); for (int i = 0; i < 10000; i++) { diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 0809b645..1f7124f9 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -40,6 +40,7 @@ struct create_synchronous } }; +using default_factory = create_synchronous; @@ -162,13 +163,13 @@ inline void drop_all() // Create and register multi/single threaded basic file logger. // Basic logger simply writes to given file without any limitations or rotations. // -template +template inline std::shared_ptr basic_logger_mt(const std::string &logger_name, const filename_t &filename, bool truncate = false) { return Factory::template create(logger_name, filename, truncate); } -template +template inline std::shared_ptr basic_logger_st(const std::string &logger_name, const filename_t &filename, bool truncate = false) { return Factory::template create(logger_name, filename, truncate); @@ -177,14 +178,14 @@ inline std::shared_ptr basic_logger_st(const std::string &logger_name, c // // Create and register multi/single threaded rotating file logger // -template +template inline std::shared_ptr rotating_logger_mt( const std::string &logger_name, const filename_t &filename, size_t max_file_size, size_t max_files) { return Factory::template create(logger_name, filename, max_file_size, max_files); } -template +template inline std::shared_ptr rotating_logger_st( const std::string &logger_name, const filename_t &filename, size_t max_file_size, size_t max_files) { @@ -194,13 +195,13 @@ inline std::shared_ptr rotating_logger_st( // // Create file logger which creates new file on the given time (default in midnight): // -template +template inline std::shared_ptr daily_logger_mt(const std::string &logger_name, const filename_t &filename, int hour = 0, int minute = 0) { return Factory::template create(logger_name, filename, hour, minute); } -template +template inline std::shared_ptr daily_logger_st(const std::string &logger_name, const filename_t &filename, int hour = 0, int minute = 0) { return Factory::template create(logger_name, filename, hour, minute); @@ -209,7 +210,7 @@ inline std::shared_ptr daily_logger_st(const std::string &logger_name, c #ifdef SPDLOG_ENABLE_SYSLOG // Create and register a syslog logger -template +template inline std::shared_ptr syslog_logger( const std::string &logger_name, const std::string &ident = "", int syslog_option = 0, int syslog_facilty = (1 << 3)) { @@ -219,7 +220,7 @@ inline std::shared_ptr syslog_logger( #if defined(__ANDROID__) // Create and register android syslog logger -template +template inline std::shared_ptr android_logger(const std::string &logger_name, const std::string &tag = "spdlog") { return return Factory::template create(logger_name, tag);