A logger that logs all messages to an in-memory buffer of type AString. The name of the Logger defaults to "MEMORY".
Definition at line 22 of file memorylogger.hpp.
#include <memorylogger.hpp>
Public Field Index: | |
AString | MemoryLog |
bool | UseWStringLengthForTabAdjustments = true |
Public Field Index: inherited from PlainTextLogger | |
bool | PruneESCSequences = true |
Public Field Index: inherited from TextLogger | |
strings::util::AutoSizes | AutoSizes |
ObjectConverter * | Converter = nullptr |
String16 | FmtMsgSuffix |
String64 | FmtMultiLineMsgHeadline = A_CHAR("ALox: Multi line message follows: ") |
String16 | FmtMultiLinePrefix = A_CHAR(">> ") |
String16 | FmtMultiLineSuffix = A_CHAR("") |
textlogger::MetaInfo * | MetaInfo |
AString | MultiLineDelimiter |
String16 | MultiLineDelimiterRepl = A_CHAR("\\r") |
int | MultiLineMsgMode =2 |
Public Field Index: inherited from Logger | |
integer | CntLogs =0 |
time::Ticks | TimeOfCreation |
time::Ticks | TimeOfLastLog |
Public Field Index: inherited from ThreadLock | |
NCString | DbgOwnerFile =nullptr |
NCString | DbgOwnerFunc =nullptr |
int | DbgOwnerLine |
uint16_t | DbgRecursionWarningThreshold =10 |
integer | DbgWarningAfterWaitTimeInMillis =2000L |
Public Method Index: | |
MemoryLogger (const NString &name=nullptr, bool pruneESCSequences=true, bool useWStringLengthForTabAdjustments=true) | |
virtual | ~MemoryLogger () override |
Public Method Index: inherited from TextLogger | |
virtual ALIB_API | ~TextLogger () override |
virtual ALIB_API void | AcknowledgeLox (LoxImpl *lox, lang::ContainerOp op) override |
virtual ALIB_API void | ClearReplacements () |
virtual ALIB_API void | Log (Domain &domain, Verbosity verbosity, Boxes &logables, ScopeInfo &scope) override |
virtual ALIB_API void | ResetAutoSizes () |
virtual ALIB_API void | SetReplacement (const String &searched, const String &replacement) |
Public Method Index: inherited from Logger | |
virtual | ~Logger () |
const NString & | GetName () const |
const NString & | GetTypeName () const |
Public Method Index: inherited from SmartLock | |
SmartLock () | |
void | Acquire (const NCString &dbgFile, int dbgLine, const NCString &dbgFunc) |
ALIB_API int | AddAcquirer (ThreadLock *newAcquirer) |
ALIB_API int | CntAcquirers () |
ALIB_API void | Release () |
defined(ALIB_DOX) | |
ALIB_API int | RemoveAcquirer (ThreadLock *acquirer) |
Public Method Index: inherited from ThreadLock | |
ALIB_API | ThreadLock (lang::Safeness safeness=lang::Safeness::Safe) |
ALIB_API | ~ThreadLock () |
ALIB_API void | Acquire (const NCString &dbgFile, int dbgLine, const NCString &dbgFunc) |
int | CountAcquirements () const |
Thread * | GetOwner () const |
lang::Safeness | GetSafeness () const |
bool | IsOwnedByCurrentThread () const |
ALIB_API void | Release () |
defined(ALIB_DOX) | |
ALIB_API void | SetSafeness (lang::Safeness safeness) |
bool | WillRelease () const |
Additional Inherited Members | |
Public Type Index: inherited from TextLogger | |
enum class | LightColorUsage { Auto , Never , Foreground , Background } |
Public Static Field Index: inherited from SmartLock | |
static ALIB_API SmartLock | StdOutputStreams |
AString MemoryLog |
The logging Buffer. This can be accessed publicly and hence used as preferred. Especially, the whole log can easily be cleared using AString::Reset . In multi-threaded environments, Lox
interface's mutex should be acquired before accessing this buffer. The initial size of the buffer is 8kb.
Definition at line 35 of file memorylogger.hpp.
bool UseWStringLengthForTabAdjustments = true |
If this field is set to true
(which is the default), the effective length of the messages when converted to wide character strings are taken into account.
Switching this off increases the overall logging performance (especially when logging into memory) significantly.
Definition at line 44 of file memorylogger.hpp.
|
inlineexplicit |
Creates a MemoryLogger with the given name.
name | (Optional) The name of the Logger. Defaults to "MEMORY". |
pruneESCSequences | (Optional) Sets the member PruneESCSequences. Defaults to true . |
useWStringLengthForTabAdjustments | (Optional) Sets the member UseWStringLengthForTabAdjustments. Defaults to true . |
Definition at line 60 of file memorylogger.hpp.
|
inlineoverridevirtual |
|
inlineoverrideprotectedvirtual |
Write the given region of the given AString to the destination buffer.
buffer | The string to write a portion of. |
start | The start of the portion in buffer to write out. |
length | The length of the portion in buffer to write out. |
Implements PlainTextLogger.
Definition at line 102 of file memorylogger.hpp.
|
inlineoverrideprotectedvirtual |
Start a new log line. Appends a new-line character sequence to previously logged lines.
phase | Indicates the beginning or end of a log line. |
Implements PlainTextLogger.
Definition at line 86 of file memorylogger.hpp.
|
inlineoverrideprotectedvirtual |
Empty implementation, not needed for this class
Implements TextLogger.
Definition at line 114 of file memorylogger.hpp.