ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Methods | Protected Fields | Protected Methods | List of all members
VStudioLogger Class Reference

#include <vstudiologger.hpp>

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

Class 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.

Public Methods

ALIB_API VStudioLogger (const NString &name=nullptr)
 
virtual ALIB_API ~VStudioLogger ()
 
- Public Methods inherited from TextLogger
virtual ALIB_API ~TextLogger () override
 
virtual ALIB_API void AcknowledgeLox (LoxImpl *lox, 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 Methods inherited from Logger
virtual ~Logger ()
 
const NStringGetName () const
 
const NStringGetTypeName () const
 
- Public Methods 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) More...
 
ALIB_API int RemoveAcquirer (ThreadLock *acquirer)
 
- Public Methods inherited from ThreadLock
ALIB_API ThreadLock (Safeness safeness=Safeness::Safe)
 
ALIB_API ~ThreadLock ()
 
ALIB_API void Acquire (const NCString &dbgFile, int dbgLine, const NCString &dbgFunc)
 
int CountAcquirements () const
 
ThreadGetOwner () const
 
Safeness GetSafeness () const
 
bool IsOwnedByCurrentThread () const
 
ALIB_API void Release ()
 defined(ALIB_DOX) More...
 
ALIB_API void SetSafeness (Safeness safeness)
 
bool WillRelease () const
 

Protected Fields

AString outputString
 
- Protected Fields inherited from TextLogger
AString logBuf
 
AString msgBuf
 
std::vector< AStringreplacements
 
int stdStreamLockRegistrationCounter =0
 
bool usesStdStreams
 
- Protected Fields inherited from Logger
NString32 Name
 
NString32 TypeName
 
- Protected Fields inherited from SmartLock
std::vector< ThreadLock * > acquirers
 
ThreadLockNR lock
 
- Protected Fields inherited from ThreadLock
uint16_t cntAcquirements =0
 
std::mutex mutex
 
std::condition_variable mutexNotifier
 
std::thread::id owner
 
Safeness safeness
 

Protected Methods

virtual ALIB_API integer logSubstring (const String &buffer, integer start, integer length)
 
virtual ALIB_API bool notifyLogOp (lib::Phase phase)
 
virtual ALIB_API void notifyMultiLineOp (lib::Phase)
 
- Protected Methods inherited from PlainTextLogger
 PlainTextLogger (const NString &name, const NString &typeName, bool pUsesStdStreams)
 
virtual ~PlainTextLogger () override
 
virtual ALIB_API void logText (detail::Domain &domain, Verbosity verbosity, AString &msg, detail::ScopeInfo &scope, int lineNumber) override
 
- Protected Methods inherited from TextLogger
ALIB_API TextLogger (const NString &pName, const NString &typeName, bool pUsesStdStreams)
 
- Protected Methods inherited from Logger
 Logger (const NString &name, const NString &typeName)
 

Additional Inherited Members

- Public Types inherited from TextLogger
enum  LightColorUsage { Auto, Never, Foreground, Background }
 
- Public Static Fields inherited from SmartLock
static ALIB_API SmartLock StdOutputStreams
 
- Public Fields inherited from PlainTextLogger
bool PruneESCSequences = true
 
- Public Fields inherited from TextLogger
lib::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 Fields inherited from Logger
integer CntLogs =0
 
lib::time::Ticks TimeOfCreation
 
lib::time::Ticks TimeOfLastLog
 
- Public Fields inherited from ThreadLock
NCString DbgOwnerFile =nullptr
 
NCString DbgOwnerFunc =nullptr
 
int DbgOwnerLine
 
uint16_t DbgRecursionWarningThreshold =10
 
integer DbgWarningAfterWaitTimeInMillis =2000L
 

Constructor & Destructor Documentation

◆ 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.

Member Function Documentation

◆ 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 ( lib::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 ( lib::Phase  )
inlineprotectedvirtual

Empty implementation, not needed for this class

Implements TextLogger.

Definition at line 95 of file vstudiologger.hpp.

Member Data Documentation

◆ 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.


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