ALox  V. 2402 R. 0
Home ALox for C++ ALox for C# ALox for Java Download
Public Fields | Public Methods | Protected Methods | List of all members
MemoryLogger Class Reference
Inheritance diagram for MemoryLogger:
[legend]
Collaboration diagram for MemoryLogger:
[legend]

Class Description


A logger that logs all messages to an in-memory buffer of type AString. The name of the Logger defaults to "MEMORY".

Public Fields

AString MemoryLog = new AString( 8192 )
 
- Public Fields inherited from PlainTextLogger
bool PruneESCSequences = true
 
- Public Fields inherited from TextLogger
AutoSizes AutoSizes = new AutoSizes()
 
ObjectConverter Converter
 
String FmtMsgSuffix =""
 
String FmtMultiLineMsgHeadline ="ALox: Multi line message follows: "
 Headline for multi line messages (depending on MultiLineMsgMode).
 
String FmtMultiLinePrefix =">> "
 
String FmtMultiLineSuffix =null
 
MetaInfo MetaInfo =new MetaInfo()
 
String MultiLineDelimiter =null
 
String MultiLineDelimiterRepl ="\\r"
 
int MultiLineMsgMode =2
 
- Public Fields inherited from Logger
int CntLogs
 
Ticks TimeOfCreation = new Ticks()
 The creation time of the Logger.
 
Ticks TimeOfLastLog = new Ticks()
 Timestamp of the last log operation.
 
- Public Fields inherited from ThreadLock
int RecursionWarningThreshold =10
 
int waitWarningTimeLimitInMillis =1000
 

Public Methods

 MemoryLogger (String name=null, bool pruneESCSequences=true)
 
- Public Methods inherited from TextLogger
override int AddAcquirer (ThreadLock newAcquirer)
 
void ClearReplacements ()
 
override void Log (Domain domain, Verbosity verbosity, List< Object > logables, ScopeInfo scope)
 
override int RemoveAcquirer (ThreadLock acquirer)
 
void ResetAutoSizes ()
 
void SetReplacement (String searched, String replacement)
 
- Public Methods inherited from Logger
String GetName ()
 
String GetTypeName ()
 
override String ToString ()
 
- Public Methods inherited from SmartLock
 SmartLock ()
 
int CntAcquirers ()
 
- Public Methods inherited from ThreadLock
 ThreadLock (LockMode lockMode=LockMode.Recursive, Safeness safeness=Safeness.Safe)
 
virtual void Acquire ([CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="")
 
int DbgCountAcquirements (Thread thread=null)
 
LockMode GetMode ()
 
Safeness GetSafeness ()
 
virtual void Release ()
 
void SetSafeness (Safeness safeness)
 
override String ToString ()
 
bool WillRelease ()
 

Protected Methods

override bool logSubstring (AString buffer, int start, int length)
 
override bool notifyLogOp (Phase phase)
 
override void notifyMultiLineOp (Phase phase)
 
- Protected Methods inherited from PlainTextLogger
 PlainTextLogger (String name, String typeName, bool usesStdStreams)
 
override void logText (Domain domain, Verbosity verbosity, AString msg, ScopeInfo scope, int lineNumber)
 
- Protected Methods inherited from TextLogger
 TextLogger (String name, String typeName, bool usesStdStreams)
 
- Protected Methods inherited from Logger
 Logger (String name, String typeName)
 

Additional Inherited Members

- Protected Fields inherited from TextLogger
AString logBuf =new AString( 256 )
 
AString msgBuf =new AString( 128 )
 
List< String > replacements =new List<String>()
 
int stdStreamLockRegistrationCounter =0
 
bool usesStdStreams
 
- Protected Fields inherited from Logger
String Name
 
String TypeName
 
- Protected Fields inherited from SmartLock
List< ThreadLockacquirers =new List<ThreadLock>()
 
- Protected Fields inherited from ThreadLock
int cntAcquirements
 
LockMode lockMode
 
Object mutex
 
Thread owner
 
Ticks waitTime =new Ticks()
 

Constructor & Destructor Documentation

◆ MemoryLogger()

MemoryLogger ( String  name = null,
bool  pruneESCSequences = true 
)
inline

Creates a MemoryLogger with the given name.

Parameters
name(Optional) The name of the Logger. Defaults to "MEMORY".
pruneESCSequences(Optional) Sets the member PruneESCSequences. Defaults to true.

Member Function Documentation

◆ logSubstring()

override bool logSubstring ( AString  buffer,
int  start,
int  length 
)
inlineprotectedvirtual

Write the given region of the given AString to the destination buffer.

Parameters
bufferThe string to write a portion of.
startThe start of the portion in buffer to write out.
lengthThe length of the portion in buffer to write out.
Returns
Always returns true.

Implements PlainTextLogger.

◆ notifyLogOp()

override bool notifyLogOp ( Phase  phase)
inlineprotectedvirtual

Start a new log line. Appends a new-line character sequence to previously logged lines.

Parameters
phaseIndicates the beginning or end of a log operation.
Returns
Always returns true.

Implements PlainTextLogger.

◆ notifyMultiLineOp()

override void notifyMultiLineOp ( Phase  phase)
inlineprotectedvirtual

Empty, not needed here

Parameters
phaseIndicates the beginning or end of a multi-line operation.

Implements TextLogger.

Member Data Documentation

◆ MemoryLog

AString MemoryLog = new AString( 8192 )

The logging Buffer. This can be accessed publicly and hence used as preferred. Especially, the whole log can easily be cleared using AString.Clear. In multi-threaded environments, Lox interfaces' mutex should be acquired before accessing this buffer. The initial size of the buffer is 8kb.


The documentation for this class was generated from the following file: