Support direct creation of android logger.
This commit is contained in:
		@@ -14,6 +14,7 @@
 | 
			
		||||
#include <spdlog/sinks/stdout_sinks.h>
 | 
			
		||||
#include <spdlog/sinks/syslog_sink.h>
 | 
			
		||||
#include <spdlog/sinks/ansicolor_sink.h>
 | 
			
		||||
#include <spdlog/sinks/android_sink.h>
 | 
			
		||||
 | 
			
		||||
#include <chrono>
 | 
			
		||||
#include <functional>
 | 
			
		||||
@@ -104,6 +105,13 @@ inline std::shared_ptr<spdlog::logger> spdlog::syslog_logger(const std::string&
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(__ANDROID__)
 | 
			
		||||
inline std::shared_ptr<spdlog::logger> spdlog::android_logger(const std::string& logger_name, const std::string& tag)
 | 
			
		||||
{
 | 
			
		||||
  return create<spdlog::sinks::android_sink>(logger_name, tag);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Create and register a logger a single sink
 | 
			
		||||
inline std::shared_ptr<spdlog::logger> spdlog::create(const std::string& logger_name, const spdlog::sink_ptr& sink)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -101,6 +101,9 @@ std::shared_ptr<logger> stderr_logger_st(const std::string& logger_name, bool co
 | 
			
		||||
std::shared_ptr<logger> syslog_logger(const std::string& logger_name, const std::string& ident = "", int syslog_option = 0);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(__ANDROID__)
 | 
			
		||||
std::shared_ptr<logger> android_logger(const std::string& logger_name, const std::string& tag = "spdlog");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Create and register a logger a single sink
 | 
			
		||||
std::shared_ptr<logger> create(const std::string& logger_name, const sink_ptr& sink);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user