ALib C++ Library
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::lox::loggers::VStudioLogger Class Reference

Description:

A logger that logs to the Visual Studio output pane using OutputDebugString(). The name of the Logger defaults to "VSTUDIO_CONSOLE".

ALox text logger escape sequences (see class ESC) are removed and ignored.

Note
For the ease of use, class Log implements a method Log::AddDebugLogger that tries to create the right Logger type for standard debug logging. If a Visual Studio debug session is detected, this logger is added. If in addition, a windows console application is detected, then a second logger of type WindowsConsoleLogger is added.

Definition at line 28 of file vstudiologger.inl.

Inheritance diagram for alib::lox::loggers::VStudioLogger:
[legend]
Collaboration diagram for alib::lox::loggers::VStudioLogger:
[legend]

Public Method Index:

ALIB_DLL VStudioLogger (const NString &name=nullptr)
 
virtual ~VStudioLogger () override
 Destructs a VStudioLogger.
 
- Public Method Index: inherited from alib::lox::textlogger::TextLogger
virtual ALIB_DLL ~TextLogger () override
 Destructs a TextLogger.
 
virtual ALIB_DLL void ClearReplacements ()
 Removes all pairs of searched strings and their replacement value.
 
FormatAutoSizesGetAutoSizes ()
 
FormatDateTimeGetFormatDate ()
 
FormatMetaInfoGetFormatMetaInfo ()
 
FormatMultiLineGetFormatMultiLine ()
 
FormatOtherGetFormatOther ()
 
FormatTimeDiffGetFormatTimeDiff ()
 
ReplacementsGetReplacements ()
 
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 NStringGetName () const
 
const NStringGetTypeName () 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 Field Index:

AString outputString
 
- 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
 

Protected Method Index:

virtual ALIB_DLL void AcknowledgeLox (detail::LoxImpl *lox, lang::ContainerOp op) override
 
virtual ALIB_DLL integer logPlainTextPart (const String &buffer, integer start, integer length)
 
virtual ALIB_DLL void notifyMultiLineOp (lang::Phase)
 Empty implementation, not needed for this class.
 
virtual ALIB_DLL bool notifyPlainTextLogOp (lang::Phase phase)
 
- 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

- Public Field Index: inherited from alib::lox::textlogger::PlainTextLogger
bool PruneESCSequences =true
 
- Public Field Index: inherited from alib::lox::textlogger::TextLogger
ObjectConverterConverter = 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.
 

Field Details:

◆ outputString

AString alib::lox::loggers::VStudioLogger::outputString
protected

A character buffer used for the creation of zero-terminated output strings required by the VStudio logger interface.

If ALIB_CHARACTERS_WIDE is set, this string also acts as a converter to wide characters.

Definition at line 39 of file vstudiologger.inl.

Constructor(s) / Destructor Details:

◆ VStudioLogger()

VStudioLogger::VStudioLogger ( const NString & name = nullptr)
explicit

Creates a VStudioLogger.

Parameters
name(Optional) The name of the Logger, defaults to "VSTUDIO_CONSOLE".

Definition at line 42 of file vstudiologger.cpp.

Here is the call graph for this function:

◆ ~VStudioLogger()

virtual alib::lox::loggers::VStudioLogger::~VStudioLogger ( )
inlineoverridevirtual

Destructs a VStudioLogger.

Definition at line 51 of file vstudiologger.inl.

Method Details:

◆ AcknowledgeLox()

void VStudioLogger::AcknowledgeLox ( detail::LoxImpl * lox,
lang::ContainerOp op )
overrideprotectedvirtual

Invokes parent method. Then performs some VStudio-related adoptions.

Parameters
loxThe Lox to acknowledge insertion or removal
opThe operation. Either ContainerOp::Insert or ContainerOp::Remove.

Reimplemented from alib::lox::textlogger::TextLogger.

Definition at line 49 of file vstudiologger.cpp.

Here is the call graph for this function:

◆ logPlainTextPart()

integer VStudioLogger::logPlainTextPart ( const String & buffer,
integer start,
integer length )
protectedvirtual

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
The number of characters written, -1 on error.

Implements alib::lox::textlogger::PlainTextLogger.

Definition at line 66 of file vstudiologger.cpp.

Here is the call graph for this function:

◆ notifyMultiLineOp()

virtual ALIB_DLL void alib::lox::loggers::VStudioLogger::notifyMultiLineOp ( lang::Phase )
inlineprotectedvirtual

Empty implementation, not needed for this class.

Implements alib::lox::textlogger::TextLogger.

Definition at line 83 of file vstudiologger.inl.

◆ notifyPlainTextLogOp()

bool VStudioLogger::notifyPlainTextLogOp ( lang::Phase phase)
protectedvirtual

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 alib::lox::textlogger::PlainTextLogger.

Definition at line 59 of file vstudiologger.cpp.


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