55 + (haltOnWarnings ? 2 : 0));
71 if ( stackEmptyError )
74 ALIB_ERROR(
"REPORT",
"Stack empty, too many pop operations" );
84 writers.push( newReportWriter );
91 if (
writers.size() == 0 ) {
ALIB_ERROR(
"REPORT",
"No Writer to remove" )
return; }
92 if (
writers.top() != checkWriter ) {
ALIB_ERROR(
"REPORT",
"Report Writer is not actual" )
return; }
115 writers.top()->Report( message );
128 #if defined( _WIN32 )
139 #if defined(__GNUC__) || defined(__clang__)
140 if (halt) __builtin_trap();
141 #elif defined ( _MSC_VER )
142 if (halt) __debugbreak();
159 else buffer.
_(
"Report (type=" ).
_( msg.
Type ).
_(
") ");
169 && msg[0].IsArrayOf<
nchar>()
170 && msg[0].UnboxLength() < 29 )
172 bool illegalCharacterFound=
false;
176 char c= firstArg[idx];
178 || ( c >=
'A' && c <=
'Z' )
185 illegalCharacterFound=
true;
190 if(!illegalCharacterFound)
192 replacement <<
"in " << firstArg <<
": ";
215 for(
auto& box : msg )
216 buffer << box <<
" ";
217 buffer.
NewLine() <<
"(Note: Default Formatter was not available while writing Report)";
228 out->write( nBuffer.Buffer(), nBuffer.Length() );
233 #if defined( _WIN32 ) && ALIB_CAMP
236 #if !ALIB_CHARACTERS_WIDE
237 OutputDebugStringA( buffer );
238 OutputDebugStringA(
"\r\n" );
240 OutputDebugStringW( buffer );
241 OutputDebugStringW( L
"\r\n" );
const String & GetResource(const NString &name)
Exception & Add(const lang::CallerInfo &ci, TEnum type, TArgs &&... args)
ALIB_API AString & Format(AString &target) const
virtual ALIB_API void Report(Message &msg) override
virtual void NotifyActivation(lang::Phase phase)=0
ALIB_API void PushWriter(ReportWriter *newWriter)
ALIB_API void DoReport(Message &message)
std::stack< ReportWriter * > writers
threads::RecursiveLock lock
A Lock to protect against multithreaded calls.
ALIB_API ~Report()
Destructor.
ALIB_API void PopWriter(ReportWriter *checkWriter)
ALIB_API Report()
Constructor.
ALIB_API void PushHaltFlags(bool haltOnErrors, bool haltOnWarnings)
static ALIB_API Report * defaultReport
The default Report used internally by ALib and usually by processes that rely on ALib.
ALIB_API ReportWriter * PeekWriter()
ALIB_API void PopHaltFlags()
Restores the previous values after an invocation to PushHaltFlags.
std::stack< int > haltAfterReport
ALIB_API bool IsDebuggerPresent()
static TDerivedClass & GetSingleton()
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
void DbgDisableBufferReplacementWarning()
constexpr integer Length() const
DbgLockAsserter Dbg
The debug tool instance.
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
#define IF_ALIB_THREADS(...)
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)
#define ALIB_LOCK_RECURSIVE_WITH(lock)
#define ALIB_LOCK_WITH(lock)
platform_specific integer
@ Begin
The start of a transaction.
@ End
The end of a transaction.
ALIB_API Lock STD_IOSTREAMS_LOCK
lang::basecamp::BaseCamp BASECAMP
The singleton instance of ALib Camp class BaseCamp.
characters::nchar nchar
Type alias in namespace alib.
CallerInfo CI
The source code location that this message relates to.