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"
42 auto* os=
new std::ofstream( nFileName, std::ios::app );
46 ALIB_WARNING(
"ALOX",
"Could not open file: \"{}\". System error code: {}",
59 auto* os=
new std::ofstream( nFileName, std::ios::app );
62 writer.SetStream(
nullptr );
64 ALIB_WARNING(
"ALOX",
"Could not open file: \"{}\". System error code: {}",
66 delete os; os=
nullptr;
77 auto* stream=
writer.GetStream();
78 if( stream ==
nullptr )
81 auto* os=
dynamic_cast<std::ofstream*
>(stream);
84 writer.SetStream(
nullptr );
96 else if(
writer.GetStream() !=
nullptr )
102 auto* stream=
writer.GetStream();
104 *stream << std::endl;
virtual ALIB_DLL void notifyMultiLineOp(lang::Phase phase) override
virtual ALIB_DLL bool notifyLogOp(lang::Phase phase) override
ALIB_DLL void openFile()
Opens the file.
bool currentlyInMultiLineOp
Flag to prevent file open/close operations when multi line text logging is performed.
ALIB_DLL void closeFile()
Closes the file.
virtual ALIB_DLL integer logSubstring(const String &buffer, integer start, integer length) override
StringWriter writer
Encapsulates the text file stream in a system dependent way.
ALIB_DLL TextFileLogger(const alib::String &fileName, const alib::NString &loggerName=nullptr)
alib::AString FileName
The path and fileName to the log file.
SystemErrors LastSystemError
PlainTextLogger(const NString &name, const NString &typeName, bool pUsesStdStreams)
TString< TChar > Substring(integer regionStart, integer regionLength=MAX_LEN) const
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
#define ALIB_WARNING(domain,...)
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.
strings::TString< nchar > NString
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
system::SystemErrors SystemErrors
Type alias in namespace alib.