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 14 of file memorylogger.inl.
Public Field Index: | |
| AString | MemoryLog |
| bool | UseWStringLengthForTabAdjustments =true |
Public Field Index: inherited from alib::lox::textlogger::PlainTextLogger | |
| bool | PruneESCSequences =true |
Public Field Index: inherited from alib::lox::textlogger::TextLogger | |
| ObjectConverter * | Converter = nullptr |
| TickConverter | DateConverter |
| bool | FormatWarningOnce =false |
Public Field Index: inherited from alib::lox::detail::Logger | |
| integer | CntLogs =0 |
| time::Ticks | TimeOfCreation |
| The creation time of the Logger. | |
| time::Ticks | TimeOfLastLog |
| Timestamp of the last log operation. | |
Public Field Index: inherited from alib::threads::RecursiveLock | |
| DbgLockAsserter | Dbg |
| The debug tool instance. | |
Public Method Index: | |
| MemoryLogger (const NString &name=nullptr, bool pruneESCSequences=true, bool useWStringLengthForTabAdjustments=true) | |
| virtual | ~MemoryLogger () override |
| Destructs a MemoryLogger. | |
Public Method Index: inherited from alib::lox::textlogger::TextLogger | |
| virtual ALIB_DLL | ~TextLogger () override |
| Destructs a TextLogger. | |
| virtual ALIB_DLL void | AcknowledgeLox (detail::LoxImpl *lox, lang::ContainerOp op) override |
| virtual ALIB_DLL void | ClearReplacements () |
| Removes all pairs of searched strings and their replacement value. | |
| FormatAutoSizes & | GetAutoSizes () |
| FormatDateTime & | GetFormatDate () |
| FormatMetaInfo & | GetFormatMetaInfo () |
| FormatMultiLine & | GetFormatMultiLine () |
| FormatOther & | GetFormatOther () |
| FormatTimeDiff & | GetFormatTimeDiff () |
| Replacements & | GetReplacements () |
| virtual ALIB_DLL void | Log (detail::Domain &domain, Verbosity verbosity, BoxesMA &logables, detail::ScopeInfo &scope) override |
| virtual ALIB_DLL void | ResetAutoSizes () |
| virtual ALIB_DLL void | SetReplacement (const String &searched, const String &replacement) |
Public Method Index: inherited from alib::lox::detail::Logger | |
| virtual | ~Logger () override |
| Destructs a logger. | |
| const NString & | GetName () const |
| const NString & | GetTypeName () const |
Public Method Index: inherited from alib::threads::RecursiveLock | |
| ALIB_DLL void | AcquireRecursive (ALIB_DBG_TAKE_CI) |
| virtual ALIB_DLL bool | DCSIsAcquired () const override |
| virtual ALIB_DLL bool | DCSIsSharedAcquired () const override |
| ALIB_DLL void | ReleaseRecursive (ALIB_DBG_TAKE_CI) |
| ALIB_DLL bool | TryAcquire (ALIB_DBG_TAKE_CI) |
Public Method Index: inherited from alib::lang::DbgCriticalSections::AssociatedLock | |
| virtual | ~AssociatedLock () |
| Virtual Destructor. | |
Protected Method Index: | |
| virtual integer | logPlainTextPart (const String &buffer, integer start, integer length) override |
| virtual void | notifyMultiLineOp (lang::Phase) override |
| Empty implementation, not needed for this class. | |
| virtual bool | notifyPlainTextLogOp (lang::Phase phase) override |
Protected Method Index: inherited from alib::lox::textlogger::PlainTextLogger | |
| PlainTextLogger (const NString &name, const NString &typeName) | |
| virtual | ~PlainTextLogger () override |
| Destructs a MemoryLogger. | |
| virtual ALIB_DLL void | logText (detail::Domain &domain, Verbosity verbosity, AString &msg, detail::ScopeInfo &scope, int lineNumber, bool isRecursion) override |
Protected Method Index: inherited from alib::lox::textlogger::TextLogger | |
| ALIB_DLL | TextLogger (const NString &pName, const NString &typeName) |
| virtual ALIB_DLL void | processVariable (const NString &domainPath, Verbosity verbosity, detail::ScopeInfo &scope, AString &dest, Substring &variable) |
| virtual ALIB_DLL void | writeMetaInfo (AString &buffer, detail::Domain &domain, Verbosity verbosity, detail::ScopeInfo &scope) |
| virtual ALIB_DLL void | writeTimeDiff (AString &buffer, int64_t diffNanos) |
Protected Method Index: inherited from alib::lox::detail::Logger | |
| Logger (const NString &name, const NString &typeName) | |
| virtual void | AcknowledgeLox (LoxImpl *lox, lang::ContainerOp op) |
Additional Inherited Members | |
Protected Field Index: inherited from alib::lox::textlogger::TextLogger | |
| strings::util::CalendarDateTime | callerDateTime |
| AString | logBuf |
| The internal log Buffer. | |
| AString | msgBuf |
| The buffer for converting the logables. | |
| Variable | varFormatAutoSizes |
| Variable | varFormatDateTime |
| Variable | varFormatMetaInfo |
| Variable | varFormatMultiLine |
| Variable | varFormatOther |
| Variable | varFormatTimeDiff |
| Variable | varReplacements |
Protected Field Index: inherited from alib::lox::detail::Logger | |
| NString32 | Name |
| NString32 | TypeName |
Protected Field Index: inherited from alib::threads::RecursiveLock | |
| std::recursive_mutex | mutex |
| AString alib::lox::loggers::MemoryLogger::MemoryLog |
The logging Buffer. This can be accessed publicly and hence used quite freely. Especially, the whole log can easily be cleared using AString::Reset. In multithreaded environments, Lox interface's mutex should be acquired before accessing this buffer. The initial size of the buffer is 8kb.
Definition at line 25 of file memorylogger.inl.
| bool alib::lox::loggers::MemoryLogger::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 32 of file memorylogger.inl.
|
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 45 of file memorylogger.inl.
|
inlineoverridevirtual |
Destructs a MemoryLogger.
Definition at line 56 of file memorylogger.inl.
|
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 alib::lox::textlogger::PlainTextLogger.
Definition at line 79 of file memorylogger.inl.
|
inlineoverrideprotectedvirtual |
Empty implementation, not needed for this class.
Implements alib::lox::textlogger::TextLogger.
Definition at line 88 of file memorylogger.inl.
|
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 alib::lox::textlogger::PlainTextLogger.
Definition at line 66 of file memorylogger.inl.