0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Functions
clanguml::logging Namespace Reference

Functions

logger_type_t logger_type (logger_type_t type)
 
std::string to_string (logger_type_t type)
 
std::string to_string (spdlog::level::level_enum level)
 
void escape_json_string (std::string &s)
 

Function Documentation

◆ escape_json_string()

void clanguml::logging::escape_json_string ( std::string &  s)

Definition at line 72 of file logging.cc.

73{
74 clanguml::util::replace_all(s, "\\", "\\\\");
75 clanguml::util::replace_all(s, "\"", "\\\"");
76 clanguml::util::replace_all(s, "\n", "");
77 clanguml::util::replace_all(s, "\r", "");
78 clanguml::util::replace_all(s, "\t", " ");
79 clanguml::util::replace_all(s, "\b", " ");
80}

◆ logger_type()

logger_type_t clanguml::logging::logger_type ( logger_type_t  type)

Definition at line 27 of file logging.cc.

28{
29 static logger_type_t logger_type_singleton_{logger_type_t::text};
30
31 if (type != logger_type_t::get) {
32 logger_type_singleton_ = type;
33 }
34
35 return logger_type_singleton_;
36}

◆ to_string() [1/2]

std::string clanguml::logging::to_string ( logger_type_t  type)

Definition at line 38 of file logging.cc.

39{
40 switch (type) {
41 case logger_type_t::text:
42 return "text";
43 case logger_type_t::json:
44 return "json";
45 case logger_type_t::get:
46 return "get";
47 default:
48 return "<unknown>";
49 }
50}

◆ to_string() [2/2]

std::string clanguml::logging::to_string ( spdlog::level::level_enum  level)

Definition at line 52 of file logging.cc.

53{
54 switch (level) {
55 case spdlog::level::level_enum::critical:
56 return "critical";
57 case spdlog::level::level_enum::debug:
58 return "debug";
59 case spdlog::level::level_enum::err:
60 return "err";
61 case spdlog::level::level_enum::info:
62 return "info";
63 case spdlog::level::level_enum::trace:
64 return "trace";
65 case spdlog::level::level_enum::warn:
66 return "warn";
67 default:
68 return "<unknown>";
69 }
70}