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
boolean pruneESCSequences = true
 
- Public Fields inherited from TextLogger
AutoSizes autoSizes = new AutoSizes()
 
ObjectConverter converter
 
String fmtMsgSuffix =""
 
String fmtMultiLineMsgHeadline ="ALox: Multi line message follows: "
 
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()
 
Ticks timeOfLastLog = new Ticks()
 
- Public Fields inherited from ThreadLock
int recursionWarningThreshold = 10
 
int waitWarningTimeLimitInMillis = 1000
 

Public Methods

 MemoryLogger ()
 
 MemoryLogger (String name)
 
 MemoryLogger (String name, boolean pruneESCSequences)
 
- Public Methods inherited from TextLogger
int addAcquirer (ThreadLock newAcquirer)
 
void clearReplacements ()
 
void log (Domain domain, Verbosity verbosity, ArrayList< Object > logables, ScopeInfo scope)
 
int removeAcquirer (ThreadLock acquirer)
 
void resetAutoSizes ()
 
void setReplacement (String searched, String replacement)
 
- Public Methods inherited from Logger
String getName ()
 
String getTypeName ()
 
String toString ()
 
- Public Methods inherited from SmartLock
 SmartLock ()
 
int cntAcquirers ()
 
- Public Methods inherited from ThreadLock
 ThreadLock ()
 
 ThreadLock (LockMode lockMode)
 
 ThreadLock (LockMode lockMode, Safeness safeness)
 
void acquire ()
 
int dbgCountAcquirements (Thread thread)
 
LockMode getMode ()
 
Safeness getSafeness ()
 
void release ()
 
void setSafeness (Safeness safeness)
 
boolean willRelease ()
 

Protected Methods

boolean logSubstring (AString buffer, int start, int length)
 
boolean notifyLogOp (Phase phase)
 
void notifyMultiLineOp (Phase phase)
 
- Protected Methods inherited from PlainTextLogger
 PlainTextLogger (String name, String typeName, boolean usesStdStreams)
 
void logText (Domain domain, Verbosity verbosity, AString msg, ScopeInfo scope, int lineNumber)
 
- Protected Methods inherited from TextLogger
 TextLogger (String name, String typeName, boolean 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 )
 
ArrayList< String > replacements = new ArrayList<String>()
 
int stdStreamLockRegistrationCounter =0
 
boolean usesStdStreams
 
- Protected Fields inherited from Logger
String name
 
String typeName
 
- Protected Fields inherited from SmartLock
ArrayList< ThreadLockacquirers = new ArrayList<ThreadLock>()
 
- Protected Fields inherited from ThreadLock
int cntAcquirements
 
boolean createOwnerStackTrace = false
 
LockMode lockMode
 
Object mutex
 
Thread owner
 
Exception ownerException
 
Ticks waitTime = new Ticks()
 
- Package Access Methods inherited from ThreadLock
void constructor (LockMode lockMode, Safeness safeness)
 

Constructor & Destructor Documentation

◆ MemoryLogger() [1/3]


Creates a MemoryLogger with the name "MEMORY".

◆ MemoryLogger() [2/3]

MemoryLogger ( String  name)

Creates a MemoryLogger with the given name.

Parameters
nameThe name of the Logger. Defaults to "MEMORY".

◆ MemoryLogger() [3/3]

MemoryLogger ( String  name,
boolean  pruneESCSequences 
)

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()

boolean logSubstring ( AString  buffer,
int  start,
int  length 
)
protected

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.

Reimplemented from PlainTextLogger.

◆ notifyLogOp()

boolean notifyLogOp ( Phase  phase)
protected

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.

Reimplemented from PlainTextLogger.

◆ notifyMultiLineOp()

void notifyMultiLineOp ( Phase  phase)
protected

Empty, not needed here

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

Reimplemented from 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: