mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-07 15:20:31 +00:00
21 lines
553 B
C++
21 lines
553 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"] = llarp::time_now_ms();
|
|
obj["nickname"] = nodename;
|
|
obj["file"] = std::string(fname);
|
|
obj["line"] = lineno;
|
|
obj["level"] = LogLevelToString(lvl);
|
|
obj["message"] = msg;
|
|
m_Lines.emplace_back(obj.dump());
|
|
}
|
|
|
|
} // namespace llarp
|