6 #define SPDLOG_TRACE_ON 7 #define SPDLOG_DEBUG_ON 9 #include "spdlog/spdlog.h" 10 #include "spdlog/sinks/stdout_sinks.h" 11 #include "spdlog/sinks/basic_file_sink.h" 12 #include "spdlog/async.h" 13 #include "spdlog/sinks/stdout_color_sinks.h" 14 #include "spdlog/fmt/fmt.h" 15 #include "spdlog/fmt/ostr.h" 27 virtual void Init()
override;
54 #if FLING_DEBUG || defined ( F_ENABLE_LOGGING ) 56 #define F_LOG_TRACE( ... ) Fling::Logger::GetCurrentConsole()->info( __VA_ARGS__ ); Fling::Logger::GetCurrentLogFile()->info( __VA_ARGS__ ) 57 #define F_LOG_WARN( ... ) Fling::Logger::GetCurrentConsole()->warn( __VA_ARGS__ ); Fling::Logger::GetCurrentLogFile()->warn( __VA_ARGS__ ) 58 #define F_LOG_ERROR( ... ) Fling::Logger::GetCurrentConsole()->error( __VA_ARGS__ ); Fling::Logger::GetCurrentLogFile()->error( __VA_ARGS__ ); 62 #define F_LOG_FATAL( ... ) Fling::Logger::GetCurrentConsole()->error( __VA_ARGS__ ); \ 63 throw std::runtime_error( __VA_ARGS__ ) 67 #define F_LOG_TRACE( ... ) 68 #define F_LOG_WARN( ... ) 69 #define F_LOG_ERROR( ... ) 73 #define F_LOG_FATAL( ... ) Fling::Logger::GetCurrentConsole()->error( __VA_ARGS__ ); \ 74 throw std::runtime_error( __VA_ARGS__ ) static std::shared_ptr< spdlog::logger > m_Console
Pointer to the current console that is being used for logging.
Definition: Logger.h:44
static std::shared_ptr< spdlog::logger > GetCurrentLogFile()
Get the current async log file that is being written to.
Definition: Logger.cpp:42
virtual void Init() override
Definition: Logger.cpp:10
Class that can have only one instance.
Definition: Singleton.hpp:11
static std::shared_ptr< spdlog::logger > GetCurrentConsole()
Gets a reference to the current logging console
Definition: Logger.cpp:37
Singleton class that allows logging to the console as well as async to a file.
Definition: Logger.h:23
static std::shared_ptr< spdlog::logger > m_FileLog
Pointer to the log file logger.
Definition: Logger.h:47