ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
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 34 of file vstudiologger.hpp.

#include <vstudiologger.hpp>

Inheritance diagram for VStudioLogger:
[legend]
Collaboration diagram for VStudioLogger:
[legend]

Public Method Index:

ALIB_API VStudioLogger (const NString &name=nullptr)
 
virtual ALIB_API ~VStudioLogger ()
 
- 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 NStringGetName () const
 
const NStringGetTypeName () 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
 
ThreadGetOwner () 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
 
- Public Field Index: inherited from PlainTextLogger
bool PruneESCSequences = true
 
- Public Field Index: inherited from TextLogger
strings::util::AutoSizes AutoSizes
 
ObjectConverterConverter = nullptr
 
String16 FmtMsgSuffix
 
String64 FmtMultiLineMsgHeadline = A_CHAR("ALox: Multi line message follows: ")
 
String16 FmtMultiLinePrefix = A_CHAR(">> ")
 
String16 FmtMultiLineSuffix = A_CHAR("")
 
textlogger::MetaInfoMetaInfo
 
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
 

Field Details:

◆ outputString

AString 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 47 of file vstudiologger.hpp.

Constructor(s) / Destructor Details::

◆ 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 39 of file vstudiologger.cpp.

Here is the call graph for this function:

◆ ~VStudioLogger()

~VStudioLogger ( )
virtual

Destructs a VStudioLogger

Definition at line 48 of file vstudiologger.cpp.

Method Details:

◆ logSubstring()

integer logSubstring ( 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 PlainTextLogger.

Definition at line 58 of file vstudiologger.cpp.

Here is the call graph for this function:

◆ notifyLogOp()

bool notifyLogOp ( 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 PlainTextLogger.

Definition at line 51 of file vstudiologger.cpp.

◆ notifyMultiLineOp()

virtual ALIB_API void notifyMultiLineOp ( lang::Phase )
inlineprotectedvirtual

Empty implementation, not needed for this class

Implements TextLogger.

Definition at line 95 of file vstudiologger.hpp.


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