ALib C++ Library
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
consolelogger.cpp
1//##################################################################################################
2// ALib C++ 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//============================================== Module ============================================
18#if ALIB_C20_MODULES
19 module ALib.ALox.Impl;
20 import ALib.Lang;
21 import ALib.Strings;
22#else
23# include "ALib.Lang.H"
24# include "ALib.Strings.H"
25# include "ALib.ALox.H"
26# include "ALib.ALox.Impl.H"
27#endif
28//========================================== Implementation ========================================
29using namespace alib;
30
32 if ( phase == lang::Phase::Begin )
33 writer.Construct(std::cout, ma);
34 if ( phase == lang::Phase::End ) {
35 writer->Write( NNEW_LINE );
36 writer.Destruct();
37 ma.Reset();
38 }
39 return true;
40}
41
43 integer printedWidth;
44 writer->Write( buffer.Substring<NC>( start, length ), &printedWidth );
45 return printedWidth;
46}
virtual ALIB_DLL integer logPlainTextPart(const String &buffer, integer start, integer length) override
MonoAllocator ma
Allocator used for the OStreamWriter.
virtual ALIB_DLL bool notifyPlainTextLogOp(lang::Phase phase) override
lang::Placeholder< OStreamWriter< nchar, MonoAllocator, true > > writer
TString< TChar > Substring(integer regionStart, integer regionLength=MAX_LEN) const
Definition string.inl:384
Phase
Denotes a phase, e.g.,of a transaction.
@ Begin
The start of a transaction.
@ End
The end of a transaction.
lang::integer integer
Type alias in namespace alib.
Definition integers.inl:149
constexpr NCString NNEW_LINE
A zero-terminated string containing the new-line character sequence.
Definition cstring.inl:625
strings::TString< character > String
Type alias in namespace alib.
Definition string.inl:2189