mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
273270916e
This commit reflects changes to clang-format rules. Unfortunately, these rule changes create a massive change to the codebase, which causes an apparent rewrite of git history. Git blame's --ignore-rev flag can be used to ignore this commit when attempting to `git blame` some code.
25 lines
546 B
C++
25 lines
546 B
C++
#include <util/logging/json_logger.hpp>
|
|
#include <util/json.hpp>
|
|
|
|
namespace llarp
|
|
{
|
|
void
|
|
JSONLogStream::AppendLog(
|
|
LogLevel lvl,
|
|
const char* fname,
|
|
int lineno,
|
|
const std::string& nodename,
|
|
const std::string msg)
|
|
{
|
|
json::Object obj;
|
|
obj["time"] = to_json(llarp::time_now_ms());
|
|
obj["nickname"] = nodename;
|
|
obj["file"] = std::string(fname);
|
|
obj["line"] = lineno;
|
|
obj["level"] = LogLevelToString(lvl);
|
|
obj["message"] = msg;
|
|
m_Lines.pushBack(obj.dump());
|
|
}
|
|
|
|
} // namespace llarp
|