ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
vstudiologger.cpp
1// #################################################################################################
2// alib::lox::loggers - ALox Logging Library
3//
4// Copyright 2013-2024 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6// #################################################################################################
8
9#if !defined(ALIB_DOX)
10#if !defined (HPP_ALOX_VSTUDIO_LOGGER)
12#endif
13#endif // !defined(ALIB_DOX)
14
15#if defined(_MSC_VER) && ALIB_DEBUG
16
17#if !defined(ALIB_DOX)
18# if !defined (HPP_ALIB_LANG_BASECAMP)
20# endif
21#endif // !defined(ALIB_DOX)
22
23
24#if !defined(_IOSTREAM_)
25 #include <iostream>
26#endif
27#if !defined (_STRING_H) && !defined(_INC_STRING)
28 #include <string.h>
29#endif
30
31using namespace alib;
32using namespace alib::lox;
33using namespace alib::lox::detail;
34
35// #################################################################################################
36// Constructor/Destructor
37// #################################################################################################
38
40: PlainTextLogger( name, "VSTUDIO_CONSOLE", false )
41{
42 ALIB_ASSERT_ERROR ( BASECAMP.IsDebuggerPresent(), "ALOX", "This is not a debug session within Visual Studio" )
43
44 // prevent cutting off filenames
45 MetaInfo->Format.SearchAndReplace( A_CHAR("%SF:%SL:"), A_CHAR("%SP\\%SF(%SL):") );
46}
47
50
52{
53 if ( phase == lang::Phase::End )
54 OutputDebugStringA( "\r\n" );
55 return true;
56}
57
59{
60 outputString.Reset( String(buffer.Buffer() + start, length ) );
62 OutputDebugStringA ( dest );
64}
65
66
67#endif //defined(_WIN32) && ALIB_DEBUG
ALIB_API bool IsDebuggerPresent()
virtual ALIB_API bool notifyLogOp(lang::Phase phase)
ALIB_API VStudioLogger(const NString &name=nullptr)
virtual ALIB_API integer logSubstring(const String &buffer, integer start, integer length)
ALIB_API integer SearchAndReplace(TChar needle, TChar replacement, integer startIdx=0)
Definition astring.cpp:330
constexpr const TChar * Buffer() const
Definition string.hpp:350
integer WStringLength() const
#define A_CHAR(STR)
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
#define ALIB_ASSERT_ERROR(cond,...)
Definition alib.hpp:984
@ End
The end of a transaction.
Definition alib.cpp:57
lang::basecamp::BaseCamp BASECAMP
Definition basecamp.cpp:136
strings::TString< character > String
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
Definition integers.hpp:286