14#include <circle/device.h>
15#include <circle/string.h>
16#include <circle/types.h>
50 bool Initialize(CLogger &logger,
const char *fileName, CDevice *fallbackTarget);
64 int Write(
const void *buffer,
size_t count)
override;
75 bool OpenFile(
const char *fileName);
93 unsigned m_PendingFlushBytes;
94 unsigned m_PendingFlushLines;
96 static constexpr unsigned FlushByteThreshold = 1024;
97 static constexpr unsigned FlushLineThreshold = 8;
Provides file-based persistence for Circle logger messages.
Definition TFileLog.h:39
bool Start()
Attach to the logger and begin capturing output.
Definition TFileLog.cpp:83
void Stop()
Detach from the logger and flush pending output.
Definition TFileLog.cpp:98
int Write(const void *buffer, size_t count) override
Write a chunk of log data and mirror to the fallback if needed.
Definition TFileLog.cpp:114
bool Initialize(CLogger &logger, const char *fileName, CDevice *fallbackTarget)
Prepare the log target with logger, file path, and fallback device.
Definition TFileLog.cpp:49
void SetFallback(CDevice *fallbackTarget)
Change the device used when file logging is unavailable.
Definition TFileLog.cpp:78
static CTFileLog * Get()
Access the singleton file log device.
Definition TFileLog.cpp:22