ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
vstudiologger.cpp
1// #################################################################################################
2// alib::lox::loggers - ALox Logging Library
3//
4// Copyright 2013-2025 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6// #################################################################################################
7#include "alib_precompile.hpp"
8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
10#endif
11#if ALIB_C20_MODULES
12 module;
13#endif
14// ====================================== Global Fragment ======================================
16#include <iostream>
17#include <string.h>
18// =========================================== Module ==========================================
19#if ALIB_C20_MODULES
20 module ALib.ALox.Impl;
21 import ALib.Lang;
22 import ALib.Strings;
23 import ALib.Camp.Base;
24#else
25# include "ALib.Lang.H"
26# include "ALib.Strings.H"
27# include "ALib.ALox.H"
28# include "ALib.ALox.Impl.H"
29# include "ALib.Camp.Base.H"
30#endif
31// ====================================== Implementation =======================================
32#if defined(_MSC_VER) && ALIB_DEBUG
33
34using namespace alib;
35using namespace alib::lox;
36using namespace alib::lox::detail;
37
38// #################################################################################################
39// Constructor/Destructor
40// #################################################################################################
41
43: PlainTextLogger( name, "VSTUDIO_CONSOLE", false )
44{
45 ALIB_ASSERT_ERROR ( BASECAMP.IsDebuggerPresent(), "ALOX",
46 "This is not a debug session within Visual Studio" )
47}
48
52 return;
53
54 // prevent cutting off filenames
55 auto& fmt= GetFormatMetaInfo();
56 fmt.Format.SearchAndReplace( A_CHAR("%SF:%SL:"), A_CHAR("%SP\\%SF(%SL):") );
57}
58
60{
61 if ( phase == lang::Phase::End )
62 OutputDebugStringA( "\r\n" );
63 return true;
64}
65
67{
68 outputString.Reset( String(buffer.Buffer() + start, length ) );
70 OutputDebugStringA ( dest );
71 return outputString.WStringLength();
72}
73
74
75#endif //defined(_MSC_VER) && ALIB_DEBUG
76
virtual ALIB_DLL void AcknowledgeLox(detail::LoxImpl *lox, lang::ContainerOp op) override
virtual ALIB_DLL integer logSubstring(const String &buffer, integer start, integer length)
ALIB_DLL VStudioLogger(const NString &name=nullptr)
virtual ALIB_DLL bool notifyLogOp(lang::Phase phase)
PlainTextLogger(const NString &name, const NString &typeName, bool pUsesStdStreams)
virtual ALIB_DLL void AcknowledgeLox(detail::LoxImpl *lox, lang::ContainerOp op) override
FormatMetaInfo & GetFormatMetaInfo()
constexpr const TChar * Buffer() const
Definition string.inl:313
#define A_CHAR(STR)
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
#define ALIB_ASSERT_ERROR(cond, domain,...)
Definition alib.inl:1049
ContainerOp
Denotes standard container operations.
@ Insert
Denotes insertions.
Phase
Denotes a phase, e.g.,of a transaction.
@ End
The end of a transaction.
camp::Basecamp BASECAMP
The singleton instance of ALib Camp class Basecamp.
Definition basecamp.cpp:81
lang::integer integer
Type alias in namespace alib.
Definition integers.inl:149
strings::TString< nchar > NString
Type alias in namespace alib.
Definition string.inl:2390
strings::TString< character > String
Type alias in namespace alib.
Definition string.inl:2381