1 #ifndef LOGGER_H_INCLUDED_ 2 #define LOGGER_H_INCLUDED_ 4 #include "kblib/stringops.h" 7 void log(std::string_view str);
10 enum class log_level {
19 void set_log_level(log_level);
20 log_level get_log_level();
22 void set_log_output(std::ostream&);
24 template <
typename... Strings>
25 void log_debug(Strings&&... strings) {
26 if (get_log_level() >= log_level::debug) {
27 detail::log(kblib::concat(
"DEBUG: ", strings...));
31 template <
typename... Strings>
32 void log_info(Strings&&... strings) {
33 if (get_log_level() >= log_level::info) {
34 detail::log(kblib::concat(
"INFO: ", strings...));
38 template <
typename... Strings>
39 void log_notice(Strings&&... strings) {
40 if (get_log_level() >= log_level::notice) {
41 detail::log(kblib::concat(
"NOTICE: ", strings...));
45 template <
typename... Strings>
46 void log_warn(Strings&&... strings) {
47 if (get_log_level() >= log_level::warn) {
48 detail::log(kblib::concat(
"WARN: ", strings...));
52 template <
typename... Strings>
53 void log_err(Strings&&... strings) {
54 if (get_log_level() >= log_level::err) {
55 detail::log(kblib::concat(
"ERROR: ", strings...));
59 #endif // LOGGER_H_INCLUDED_ Definition: logger.cpp:14