Thrill
0.1
|
JsonLogger is a receiver of JSON output objects for logging.
Definition at line 69 of file json_logger.hpp.
#include <json_logger.hpp>
Public Member Functions | |
JsonLogger ()=default | |
open JsonLogger with ofstream uninitialized to discard log output. More... | |
JsonLogger (const std::string &path) | |
open JsonLogger with ofstream. if path is empty, output goes to stdout More... | |
JsonLogger (JsonLogger *super) | |
open JsonLogger with a super logger More... | |
template<typename... Args> | |
JsonLogger (JsonLogger *super, const Args &... args) | |
JsonLine | line () |
create new JsonLine instance which will be written to this logger. More... | |
template<typename Type > | |
JsonLine | operator<< (const Type &t) |
void | StartProfiler () |
launch background profiler More... | |
Public Attributes | |
JsonVerbatim | common_ |
common items outputted to each line More... | |
std::mutex | mutex_ |
mutex to lock logger output More... | |
std::unique_ptr< std::ostream > | os_ |
direct output stream for top loggers More... | |
JsonLogger * | super_ = nullptr |
output to superior JsonLogger More... | |
|
default |
open JsonLogger with ofstream uninitialized to discard log output.
|
explicit |
open JsonLogger with ofstream. if path is empty, output goes to stdout
Definition at line 33 of file json_logger.cpp.
References die, and JsonLogger::os_.
|
explicit |
open JsonLogger with a super logger
Definition at line 54 of file json_logger.cpp.
|
explicit |
open JsonLogger with a super logger and some additional common key:value pairs
Definition at line 416 of file json_logger.hpp.
References tlx::call_foreach(), and JsonLogger::common_.
JsonLine line | ( | ) |
create new JsonLine instance which will be written to this logger.
Definition at line 57 of file json_logger.cpp.
References JsonLogger::common_, JsonLogger::JsonLine, JsonLogger::line(), JsonLogger::os_, JsonVerbatim::str_, and JsonLogger::super_.
Referenced by JsonLogger::line(), JsonLogger::operator<<(), and Manager::RunTask().
|
inline |
Definition at line 431 of file json_logger.hpp.
References JsonLogger::line().
void StartProfiler | ( | ) |
launch background profiler
JsonVerbatim common_ |
common items outputted to each line
Definition at line 106 of file json_logger.hpp.
Referenced by JsonLogger::JsonLogger(), and JsonLogger::line().
std::mutex mutex_ |
mutex to lock logger output
Definition at line 103 of file json_logger.hpp.
std::unique_ptr<std::ostream> os_ |
direct output stream for top loggers
Definition at line 100 of file json_logger.hpp.
Referenced by JsonLogger::JsonLogger(), and JsonLogger::line().
JsonLogger* super_ = nullptr |
output to superior JsonLogger
Definition at line 97 of file json_logger.hpp.
Referenced by JsonLogger::line().