lokinet/llarp/util/logging/json_logger.hpp

30 lines
614 B
C++
Raw Normal View History

2019-06-13 13:26:34 +00:00
#ifndef LLARP_UTIL_JSON_LOGGER
#define LLARP_UTIL_JSON_LOGGER
2019-09-01 12:10:49 +00:00
#include <util/logging/file_logger.hpp>
2019-06-13 13:26:34 +00:00
namespace llarp
{
struct JSONLogStream : public FileLogStream
{
JSONLogStream(
std::function<void(FileLogStream::Work_t)> disk,
FILE* f,
llarp_time_t flushInterval,
bool closeFile)
: FileLogStream(std::move(disk), f, flushInterval, closeFile)
2019-06-13 13:26:34 +00:00
{
}
void
AppendLog(
LogLevel lvl,
const char* fname,
int lineno,
const std::string& nodename,
const std::string msg) override;
2019-06-13 13:26:34 +00:00
};
} // namespace llarp
2019-09-01 12:10:49 +00:00
#endif