|
RunicVTT Open Source Virtual Tabletop for TTRPG using P2P
|
#include <Logger.h>
Classes | |
| class | LineToLoggerBuf |
| struct | LogEntry |
| class | OstreamRedirect |
Public Types | |
| enum class | Level : uint8_t { Trace , Debug , Info , Warn , Error , Success } |
| using | Sink = std::function<void(const std::string& channel, const LogEntry& e)> |
Public Member Functions | |
| void | log (const std::string &channel, const std::string &line) |
| void | log (const std::string &channel, Level lvl, const std::string &line) |
| std::vector< LogEntry > | getChannel (const std::string &channel) |
| std::vector< std::string > | channels () const |
| void | clearChannel (const std::string &channel) |
| void | setChannelCapacity (size_t cap) |
| int | addSink (const Sink &s) |
| void | removeSink (int id) |
| void | clearSinks () |
| void | installStdCapture () |
| void | uninstallStdCapture () |
Static Public Member Functions | |
| static Logger & | instance () |
| static std::string | formatTs (uint64_t ms) |
Private Member Functions | |
| Logger ()=default | |
| void | ensureSeed_ () |
| void | commit_ (const std::string &channel, LogEntry e) |
Static Private Member Functions | |
| static uint64_t | nowMs_ () |
| static Level | autoDetect_ (const std::string &s) |
Private Attributes | |
| std::mutex | m_ |
| size_t | capacity_ = 4000 |
| std::unordered_map< std::string, std::deque< LogEntry > > | channels_ |
| int | nextSinkId_ = 0 |
| std::vector< std::pair< int, Sink > > | sinks_ |
| bool | seeded_ = false |
| std::unique_ptr< OstreamRedirect > | coutRedirect_ |
| std::unique_ptr< OstreamRedirect > | cerrRedirect_ |
| using Logger::Sink = std::function<void(const std::string& channel, const LogEntry& e)> |
|
strong |
|
privatedefault |
|
inline |
|
inlinestaticprivate |
Definition at line 268 of file Logger.h.
|
inline |
Definition at line 73 of file Logger.h.
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlinestatic |
Definition at line 135 of file Logger.h.
|
inline |
|
inline |
Definition at line 118 of file Logger.h.
|
inlinestatic |
|
inline |
|
inline |
Definition at line 54 of file Logger.h.
|
inlinestaticprivate |
|
inline |
|
inline |
|
inline |
Definition at line 127 of file Logger.h.
|
private |
|
private |
|
private |