23#define SYSTEM_LOG ::Logging::Logger()
45 std::lock_guard<std::mutex>
lock(
m_);
55 std::lock_guard<std::mutex>
lock(
m_);
62 std::lock_guard<std::mutex>
lock(
m_);
70 auto operator<<(
const T&
v) ->
decltype(std::declval<std::ostringstream&>() <<
v, std::declval<Log&>())
73 std::lock_guard<std::mutex>
lock(
m_);
81 using Manip = std::ostream& (*)(std::ostream&);
84 if (
m ==
static_cast<Manip>(&std::endl))
88 std::lock_guard<std::mutex>
lock(
m_);
94 else if (
m ==
static_cast<Manip>(&std::flush))
101 std::lock_guard<std::mutex>
lock(
m_);
131 std::lock_guard<std::mutex>
lock(
m_);
134 while ((
pos =
s.find(
'\n')) != std::string::npos)
136 std::string
line =
s.substr(0,
pos + 1);
146 std::lock_guard<std::mutex>
lock(
m_);
156 mutable std::mutex
m_;
175 if (!
Logger().GetOutputs()) {}
193 out.reserve(
s.size() + 4);
198 case '\\':
out +=
"\\\\";
break;
199 case '"':
out +=
"\\\"";
break;
200 case '\b':
out +=
"\\b";
break;
201 case '\f':
out +=
"\\f";
break;
202 case '\n':
out +=
"\\n";
break;
203 case '\r':
out +=
"\\r";
break;
204 case '\t':
out +=
"\\t";
break;
205 default:
out +=
c;
break;
215 if (
pos == std::string::npos)
return false;
217 if (
pos == std::string::npos)
return false;
232 if (
pos == std::string::npos)
return false;
234 if (
pos == std::string::npos)
return false;
241 catch (...) {
return false; }
248 out =
static_cast<int>(
d);
256 if (
pos == std::string::npos)
return false;
258 if (
pos == std::string::npos)
return false;
261 if (
json.compare(
pos, 4,
"true") == 0) {
out =
true;
return true; }
262 if (
json.compare(
pos, 5,
"false") == 0) {
out =
false;
return true; }
ComponentTypeID GetComponentTypeID_Static()
std::ostream &(*)(std::ostream &) Manip
std::ostringstream buffer_
unsigned GetOutputs() const
void SetOutputs(unsigned flags)
Log & operator<<(Manip m)
void flushCompleteLinesIfAny()
void writeToOutputs(const std::string &s)
auto operator<<(const T &v) -> decltype(std::declval< std::ostringstream & >()<< v, std::declval< Log & >())
bool Init(const std::string &filename="olympe.log")
bool InitLogger(const std::string &filename="olympe.log")
void AppendToLogWindow(const std::string &text)
void LoadOlympeConfig(const char *filename)
static std::string escape_json_string(const std::string &s)
static bool extract_json_double(const std::string &json, const std::string &key, double &out)
static bool extract_json_bool(const std::string &json, const std::string &key, bool &out)
static bool extract_json_int(const std::string &json, const std::string &key, int &out)
static bool extract_json_string(const std::string &json, const std::string &key, std::string &out)