25 #define SPDLOG_CLOCK_COARSE 28 #define SPDLOG_DISABLE_DEFAULT_LOGGER 33 #define SPDLOG_FUNCTION __PRETTY_FUNCTION__ 38 #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE 39 #else // otherwise, remove everything but "error" and worse messages 40 #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG 43 #include <spdlog/fmt/ostr.h> 44 #include <spdlog/sinks/stdout_color_sinks.h> 45 #include <spdlog/spdlog.h> 52 const std::string minimal_pattern{
"[%n:%^%-8l%$] %v"};
53 const std::string default_pattern{
"[%n:%^%-8l%$(%s:%#)] %v"};
54 const std::string source_pattern{
"[%n:%^%-8l%$(%s:%!:%#)] %v"};
71 std::shared_ptr<spdlog::logger>
create_logger(std::string
const& name,
72 bool const defaultlog =
false);
87 std::shared_ptr<spdlog::logger>
get_logger(std::string
const& name,
88 bool const defaultlog =
false);
93 static inline std::shared_ptr<spdlog::logger> corsika_logger =
117 template <
typename TLogger>
126 template <
typename TLogger>
133 #define CORSIKA_LOG_TRACE SPDLOG_TRACE 134 #define CORSIKA_LOG_DEBUG SPDLOG_DEBUG 135 #define CORSIKA_LOG_INFO SPDLOG_INFO 136 #define CORSIKA_LOG_WARN SPDLOG_WARN 137 #define CORSIKA_LOG_ERROR SPDLOG_ERROR 138 #define CORSIKA_LOG_CRITICAL SPDLOG_CRITICAL 142 #define CORSIKA_LOGGER_TRACE SPDLOG_LOGGER_TRACE 143 #define CORSIKA_LOGGER_DEBUG SPDLOG_LOGGER_DEBUG 144 #define CORSIKA_LOGGER_INFO SPDLOG_LOGGER_INFO 145 #define CORSIKA_LOGGER_WARN SPDLOG_LOGGER_WARN 146 #define CORSIKA_LOGGER_ERROR SPDLOG_LOGGER_ERROR 147 #define CORSIKA_LOGGER_CRITICAL SPDLOG_LOGGER_CRITICAL 151 #include <corsika/detail/framework/core/Logging.inl> auto add_source_info(TLogger &logger) -> void
Add the source (filename, line no) info to the logger.
std::shared_ptr< spdlog::logger > create_logger(std::string const &name, bool const defaultlog=false)
Create a new C8-style logger.
std::shared_ptr< spdlog::logger > get_logger(std::string const &name, bool const defaultlog=false)
Get a smart pointer to an existing logger.
auto set_default_level(level::level_enum const minlevel) -> void
Set the default log level for all newly created loggers.
`, since they are used everywhere as integral part of the framework.
auto reset_pattern(TLogger &logger) -> void
Reset the logging pattern to the default.