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
|
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
JSONLogStream(
|
2020-06-11 11:44:02 +00:00
|
|
|
std::function<void(FileLogStream::Work_t)> disk,
|
2020-04-07 18:38:56 +00:00
|
|
|
FILE* f,
|
|
|
|
llarp_time_t flushInterval,
|
|
|
|
bool closeFile)
|
2020-06-11 11:44:02 +00:00
|
|
|
: FileLogStream(std::move(disk), f, flushInterval, closeFile)
|
2019-06-13 13:26:34 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2020-04-07 18:38:56 +00:00
|
|
|
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
|