ALib C++ Library
by
Library Version:
2412 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
alox
loggers
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
// #################################################################################################
7
#include "
alib/alib_precompile.hpp
"
8
#if !DOXYGEN
9
# include "
alib/alox/loggers/vstudiologger.hpp
"
10
#endif
// !DOXYGEN
11
12
#if defined(_MSC_VER) && ALIB_DEBUG
13
#include "
alib/lang/basecamp/basecamp.hpp
"
14
#include <iostream>
15
#include <string.h>
16
17
using namespace
alib
;
18
using namespace
alib::lox
;
19
using namespace
alib::lox::detail
;
20
21
// #################################################################################################
22
// Constructor/Destructor
23
// #################################################################################################
24
25
VStudioLogger::VStudioLogger
(
const
NString
& name )
26
: PlainTextLogger( name,
"VSTUDIO_CONSOLE"
, false )
27
{
28
ALIB_ASSERT_ERROR
(
BASECAMP
.
IsDebuggerPresent
(),
"ALOX"
,
29
"This is not a debug session within Visual Studio"
)
30
}
31
32
VStudioLogger::~VStudioLogger
()
33
{}
34
35
void
VStudioLogger::AcknowledgeLox
(
detail::LoxImpl
* lox,
lang::ContainerOp
op ) {
36
TextLogger::AcknowledgeLox
( lox, op );
37
if
( op !=
lang::ContainerOp::Insert
)
38
return
;
39
40
// prevent cutting off filenames
41
auto
& fmt=
GetFormatMetaInfo
();
42
fmt.Format.SearchAndReplace(
A_CHAR
(
"%SF:%SL:"
),
A_CHAR
(
"%SP\\%SF(%SL):"
) );
43
}
44
45
bool
VStudioLogger::notifyLogOp
(
lang::Phase
phase)
46
{
47
if
( phase ==
lang::Phase::End
)
48
OutputDebugStringA(
"\r\n"
);
49
return
true
;
50
}
51
52
integer
VStudioLogger::logSubstring
(
const
String
& buffer,
integer
start,
integer
length )
53
{
54
outputString
.
Reset
(
String
(buffer.
Buffer
() + start, length ) );
55
ALIB_STRINGS_TO_NARROW
(
outputString
, dest, 8192);
56
OutputDebugStringA ( dest );
57
return
outputString
.
WStringLength
();
58
}
59
60
61
#endif
//defined(_MSC_VER) && ALIB_DEBUG
62
alib_precompile.hpp
basecamp.hpp
alib::lang::basecamp::BaseCamp::IsDebuggerPresent
ALIB_API bool IsDebuggerPresent()
Definition
basecamp.cpp:1057
alib::lox::loggers::VStudioLogger::~VStudioLogger
virtual ALIB_API ~VStudioLogger()
Destructs a VStudioLogger.
Definition
vstudiologger.cpp:32
alib::lox::loggers::VStudioLogger::notifyLogOp
virtual ALIB_API bool notifyLogOp(lang::Phase phase)
Definition
vstudiologger.cpp:45
alib::lox::loggers::VStudioLogger::outputString
AString outputString
Definition
vstudiologger.hpp:42
alib::lox::loggers::VStudioLogger::AcknowledgeLox
virtual ALIB_API void AcknowledgeLox(detail::LoxImpl *lox, lang::ContainerOp op) override
Definition
vstudiologger.cpp:35
alib::lox::loggers::VStudioLogger::VStudioLogger
ALIB_API VStudioLogger(const NString &name=nullptr)
Definition
vstudiologger.cpp:25
alib::lox::loggers::VStudioLogger::logSubstring
virtual ALIB_API integer logSubstring(const String &buffer, integer start, integer length)
Definition
vstudiologger.cpp:52
alib::lox::textlogger::TextLogger::GetFormatMetaInfo
FormatMetaInfo & GetFormatMetaInfo()
Definition
textlogger.hpp:279
alib::lox::textlogger::TextLogger::AcknowledgeLox
virtual ALIB_API void AcknowledgeLox(detail::LoxImpl *lox, lang::ContainerOp op) override
Definition
textlogger.cpp:592
alib::strings::TAString::Reset
TAString & Reset()
Definition
tastring.inl:1379
alib::strings::TString< nchar >
alib::strings::TString::Buffer
constexpr const TChar * Buffer() const
Definition
string.hpp:319
alib::strings::TString::WStringLength
integer WStringLength() const
A_CHAR
#define A_CHAR(STR)
Definition
prepro_macros.md:11
ALIB_STRINGS_TO_NARROW
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
Definition
strings/fwds.hpp:348
ALIB_ASSERT_ERROR
#define ALIB_ASSERT_ERROR(cond,...)
Definition
alib.hpp:1271
alib::lang::Phase
Phase
Denotes a phase, e.g.,of a transaction.
Definition
commonenumdefs.hpp:141
alib::lang::Phase::End
@ End
The end of a transaction.
alib::lang::ContainerOp
ContainerOp
Denotes standard container operations.
Definition
commonenumdefs.hpp:79
alib::lang::ContainerOp::Insert
@ Insert
Denotes insertions.
alib::lox::detail
Definition
domain.cpp:18
alib::lox
Definition
alox/alox.hpp:19
alib
Definition
alib.cpp:69
alib::BASECAMP
lang::basecamp::BaseCamp BASECAMP
The singleton instance of ALib Camp class BaseCamp.
Definition
basecamp.cpp:70
alib::String
strings::TString< character > String
Type alias in namespace alib.
Definition
strings/fwds.hpp:70
alib::integer
lang::integer integer
Type alias in namespace alib.
Definition
integers.hpp:273
alib::lox::detail::LoxImpl
Definition
loxpimpl.cpp:110
vstudiologger.hpp