17#define HPP_ALIB_LOX_PROPPERINCLUDE
21#undef HPP_ALIB_LOX_PROPPERINCLUDE
27# define UNDEFINED_THREAD threads::UNDEFINED
29# define UNDEFINED_THREAD 0
34namespace alib {
namespace lox {
namespace detail {
86 Search.
_( s, startPos, length );
239 template<
typename T,
typename... TArgs>
251#define ASSERT_ACQUIRED ALIB_ASSERT_ERROR ( impl->CountAcquirements() > 0, "ALOX", "Lox not acquired" )
263 lox->
impl= (*selfContainedMA)().New<LoxImpl>( selfContainedMA, name );
327 const NString internalDomainList[]= {
"LGR",
"DMN",
"PFX",
"THR",
"LGD",
"VAR" };
328 for (
auto& it : internalDomainList )
346 for(
int ruleNo= 0 ; ruleNo < var.
Size() ; ++ruleNo )
362 ALIB_WARNING(
"ALOX",
"Syntax error in variable {!Q}.", var )
389 (*loxMA)().Delete(impl);
390 loxMA->
Reset(snapshot);
392 (*loxMA)().New<LoxImpl>(loxMA, name );
394 ALIB_ASSERT_ERROR( impl == dbgNewAddress,
"ALOX",
"Internal error. This must never happen." )
403#if ALIB_DEBUG_MONOMEM
412 const NString& trimReplacement,
418 trimReplacement, reach, priority );
425 setDomain( impl, scopeDomain, scope,
false, thread );
437 if ( (logger= impl->
domains ->
GetLogger( loggerName ) ) !=
nullptr )
return logger;
442 logables.
Add(
"No logger named {!Q} found.", loggerName );
443 logInternal( impl, Verbosity::Warning,
"LGR", logables );
453 if( parentVerbosity != verbosity || verbosities.
ExportAll )
458 writeVerbVarRecursive( subDomain, loggerNo, verbosities, verbosity );
465DOX_MARKER([DOX_CONFIG_REPLACEMENTS2])
478DOX_MARKER( [DOX_CONFIG_REPLACEMENTS2])
489 if ( loggerNoMainDom >= 0 ) writeVerbVarRecursive( *impl->
domains , loggerNoMainDom, cvVerb,
Verbosity(-1) );
501 logables.
Add(
"Verbosities for logger {!Q} written to variable {!Q}",
503 logInternal( impl, Verbosity::Info,
"VAR", logables );
509 logables.
Add(
" Value:");
510 for(
auto it : cvVerb )
511 logables.
Add(
"\n ", it );
512 logInternal( impl, Verbosity::Verbose,
"VAR", logables );
541 tknzr.
Set(variable,
',',
true);
582 logables.
Add(
"Unknown argument {!Q} in variable {} = {!Q}.",
584 logInternal( impl, Verbosity::Error,
"VAR", logables);
589 State( impl, domain, verbosity,
A_CHAR(
"Auto dump state on exit requested: "), flags );
601 if( noMainDom >= 0 || noIntDom >= 0 )
619 logables.
Add(
"Logger {!Q} not found. Nothing removed.", logger );
620 logInternal( impl, Verbosity::Warning,
"LGR", logables );
631 if( noMainDom >= 0 || noIntDom >= 0 )
648 logables.
Add(
"Logger {!Q} removed.", logger );
649 logInternal( impl, Verbosity::Info,
"LGR", logables );
655 logables.
Add(
"Logger {!Q} not found. Nothing removed.", loggerName );
656 logInternal( impl, Verbosity::Warning,
"LGR", logables );
665 if ( logger ==
nullptr )
668 logables.
Add(
"Given Logger is \"null\". Verbosity not set." );
669 logInternal( impl, Verbosity::Error,
"LGR", logables );
678 bool isNewLogger=
false;
688 .Add(
"Unable to add logger {!Q}. Logger with same name exists.", logger ) );
693 " Request was: SetVerbosity({!Q}, {!Q}, Verbosity::{}, {}). ",
694 logger, dom->
FullPath, verbosity, priority ) );
698 .Add(
" Existing Logger: {!Q}.", existingLogger ) );
728 logables.
Add(
"Logger {!Q}.", logger );
730 logables.
Add(
" added for internal log messages.");
732 logables.
Add(
" added.");
733 logInternal( impl, Verbosity::Info,
"LGR", logables );
752 logables.
Add(
"Logger {!Q}: {!Fill}{!Q'}{!Fill}= Verbosity::{}.",
757 std::make_pair(verbosity, priority) );
760 if( actVerbosity != verbosity )
761 logables.
Add(
" Lower priority ({} < {}). Remains {}.",
764 logInternal( impl, Verbosity::Info,
"LGR", logables );
776 int no= dom->GetLoggerNo( loggerName );
778 logger= dom->GetLogger( no );
789 logables.
Add(
"Logger not found. Request was: SetVerbosity({!Q}, {!Q}, Verbosity::{}, {}).",
790 loggerName, dom->FullPath, verbosity, priority );
791 logInternal( impl, Verbosity::Warning,
"LGR", logables );
799 SetVerbosity( impl, logger, verbosity, domain, priority );
817 ThreadID threadID= thread !=
nullptr ? thread->
GetID() : UNDEFINED_THREAD;
825 impl->
scopeDomains.InitAccess( scope, pathLevel, threadID );
828 previousScopeDomain= impl->
scopeDomains.Remove( scopeDomain );
838 previousScopeDomain= impl->
scopeDomains.Remove(
nullptr );
843 if ( !removeNTRSD && scopeDomain.
IsNotEmpty() )
845 logables.
Add(
"{!Q'} set as default for {}.", scopeDomain, (scope + pathLevel) );
847 if ( previousScopeDomain ==
nullptr )
848 logInternal( impl, Verbosity::Info,
"DMN", logables );
851 if ( previousScopeDomain.
Equals<
NC>( scopeDomain ) )
853 logables.
Add(
" (Was already set.)" );
854 logInternal( impl, Verbosity::Verbose,
"DMN", logables );
858 logables.
Add(
" Replacing previous default {!Q'}.", previousScopeDomain );
859 logInternal( impl, Verbosity::Warning,
"DMN", logables );
866 if ( previousScopeDomain !=
nullptr )
868 logables.
Add(
"{!Q'} removed from {}.", previousScopeDomain, (scope + pathLevel) );
869 logInternal( impl, Verbosity::Info,
"DMN", logables );
874 logables.
Add(
"{!Q'} not found. Nothing removed for {}.", scopeDomain );
876 logables.
Add(
"Empty Scope Domain given, nothing registered for {}.", scopeDomain);
878 logables.
Add( scope + pathLevel);
879 logInternal( impl, Verbosity::Warning,
"DMN", logables );
897 logables.
Add(
"Illegal parameter. No scope domain path given. Nothing removed for {}.",
899 logInternal( impl, Verbosity::Warning,
"DMN", logables );
906 setDomain( impl, scopeDomain, scope,
true, thread);
916 logInternal( impl, Verbosity::Info,
"DMN",
"Domain substitution rules removed.");
925 logInternal( impl, Verbosity::Warning,
"DMN",
"Illegal domain substitution rule. Nothing stored." );
933 if ( (*it).type == newRule.
type
934 && (*it).Search.Equals<
NC>( newRule.
Search ) )
944 logables.
Add(
"Domain substitution rule {!Q} not found. Nothing to remove.", domainPath );
945 logInternal( impl, Verbosity::Warning,
"DMN", logables );
949 logables.
Add(
"Domain substitution rule {!Q} -> {!Q} removed.", domainPath, (*it).Replacement );
950 logInternal( impl, Verbosity::Info,
"DMN", logables );
956 logables.
Add(
"Domain substitution rule {!Q} -> {!Q} set.", domainPath, newRule.
Replacement );
962 msg <<
" Replacing previous -> \"" << (*it).Replacement <<
"\".";
970 logInternal( impl, Verbosity::Info,
"DMN", logables );
983 ThreadID threadID= thread !=
nullptr ? thread->
GetID() : UNDEFINED_THREAD;
989 impl->
scopePrefixes.InitAccess( scope, pathLevel, threadID );
990 bool isVoidOrEmpty= prefix.
IsType<
void>()
999 logables.
Add(
"Object ");
1000 Verbosity intMsgVerbosity= Verbosity::Info;
1001 if ( !isVoidOrEmpty )
1003 logables.
Add( prefix,
" added as prefix logable for {}.", (scope + pathLevel) );
1005 if ( previousLogable !=
nullptr )
1009 logables.
Add(
" (Same as before.)");
1010 intMsgVerbosity= Verbosity::Verbose;
1013 logables.
Add(
" Replacing previous {}.", *previousLogable );
1018 if ( previousLogable !=
nullptr )
1019 logables.
Add(
"{!Q} removed from list of prefix logables for {}.", *previousLogable);
1022 logables.
Add(
"<nullptr> given but no prefix logable to remove for {}.");
1023 intMsgVerbosity= Verbosity::Warning;
1025 logables.
Add( scope + pathLevel );
1028 logInternal( impl, intMsgVerbosity,
"PFX", logables );
1031 if ( previousLogable !=
nullptr )
1043 bool isVoidOrEmpty= prefix.
IsType<
void>()
1048 Verbosity intLogVerbosity= Verbosity::Info;
1051 if ( !isVoidOrEmpty )
1054 logables.
Add(
"Object {} added as prefix logable for ", prefix );
1060 auto cntPLs= dom->PrefixLogables.Count();
1063 removedLogable= dom->PrefixLogables.Back().first;
1064 dom->PrefixLogables.PopBack();
1065 logables.
Add(
"Object {} removed from list of prefix logables for",
1066 *
static_cast<Box*
>(removedLogable) );
1070 logables.
Add(
"No prefix logables to remove for" );
1071 intLogVerbosity= Verbosity::Warning;
1075 logables.
Add(
" domain {!Q'}.", dom->FullPath);
1076 logInternal( impl, intLogVerbosity,
"PFX", logables );
1078 if( removedLogable )
1083#if defined (__GLIBCXX__) || defined(__APPLE__) || defined(__ANDROID_NDK__)
1090#elif defined( _WIN32 )
1097 #pragma message "Unknown Platform in file: " __FILE__ )
1104 bool foundOne=
false;
1115 logables.
Add(
"Logger {!Q}: Start time set to ", logger->
GetName() );
1116 if ( !startTime.
IsSet() )
1119 logables.
Add(
"'now'" );
1125 if( asTextLogger !=
nullptr )
1129 logables.
Add(
"{:yyyy-MM-dd HH:mm:ss}", asDateTime );
1135 logInternal( impl, Verbosity::Info,
"LGR", logables );
1141 logables.
Add(
"Logger {!Q}: not found. Start time not set.", loggerName );
1142 logInternal( impl, Verbosity::Error,
"LGR", logables );
1163 origThreadName=
nullptr;
1170 logables.
Add(
"Mapped thread ID {} to {!Q}.",
id, threadName);
1171 if ( origThreadName.IsNotEmpty() )
1172 logables.
Add(
" Original thread name: {!Q}.", origThreadName );
1173 logInternal( impl, Verbosity::Info,
"THR", logables );
1194 bool groupWasEmtpy= group.
IsEmpty();
1195 if ( groupWasEmtpy )
1198 if ( scope == Scope::Global )
1200 scope= Scope::Filename;
1212 impl->
scopeLogOnce.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1215 if( map ==
nullptr )
1222 auto it= map->
Find( group );
1223 if (it == map->
end() )
1227 if ( quantity >= 0 )
1229 if ( it->second < quantity )
1235 Entry( impl, domain, verbosity );
1238 if( it->second == quantity )
1241 logables.
Add(
"Once() reached limit of {} logs. No further logs for ", quantity );
1243 if ( groupWasEmtpy )
1244 logables.
Add( scope == Scope::Global ?
Box(
"this line" )
1245 :
Box(scope + pathLevel) );
1248 logables.
Add(
"group {!Q}", group );
1249 if ( scope != Scope::Global )
1250 logables.
Add(
" in ", (scope + pathLevel) );
1254 logInternal( impl, Verbosity::Info,
"", logables );
1262 if ( it->second++ % -quantity == 0 )
1265 Entry( impl, domain, verbosity );
1275 bool keyWasEmtpy= key.
IsEmpty();
1281 if ( scope > Scope::Path )
1283 pathLevel= UnderlyingIntegral( scope - Scope::Path );
1288 impl->
scopeLogData.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1290 if( map ==
nullptr )
1299 auto it= map->
Find( key );
1300 if ( !data.
IsType<
void>() )
1302 bool replacedPrevious=
false;
1303 if ( it == map->
end() )
1307 replacedPrevious=
true;
1312 logables.
Add(
"Stored data " );
1315 logables.
Add(
" with key {!Q} ", key );
1316 logables.
Add(
"in {}.", (scope + pathLevel) );
1317 if ( replacedPrevious )
1318 logables.
Add(
" (Replaced and deleted previous.)" );
1324 if ( it != map->
end() )
1326 auto keyString= it->first;
1328 if ( map->
Size() == 0 )
1334 logables.
Add(
"Deleted map data " );
1337 logables.
Add(
"No map data found to delete " );
1340 logables.
Add(
" with key {!Q} ", key );
1341 logables.
Add(
"in {}.", (scope + pathLevel) );
1353 bool keyWasEmtpy= key.
IsEmpty();
1358 if ( scope > Scope::Path )
1360 pathLevel= UnderlyingIntegral( scope - Scope::Path );
1365 impl->
scopeLogData.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1368 if( map !=
nullptr )
1370 auto it= map->
Find( key );
1371 if ( it != map->
end() )
1372 returnValue= it->second;
1375 if ( returnValue.
IsType<
void>() )
1376 store( impl,
Box(), pKey, scope + pathLevel );
1380 logables.
Add(
"Data " );
1383 logables.
Add(
" with key {!Q} ", key );
1384 logables.
Add(
"in ", (scope + pathLevel), ( !returnValue.
IsType<
void>() ?
" received."
1385 :
" not found." ) );
1387 logInternal( impl, Verbosity::Info,
"LGD", logables );
1403 buf._<
NC>( headLine ).NewLine();
1408 Entry( impl, domain, verbosity );
1416 while( static_cast<int>(impl->logableContainers.size()) < cntAcquirements )
1417 impl->logableContainers.emplace_back( impl->monoAllocator().New<BoxesMA>(impl->monoAllocator) );
1418 BoxesMA& logables= *impl->logableContainers[size_t(cntAcquirements - 1)];
1423void LI::Entry(LoxImpl* impl, const NString& domain, Verbosity verbosity )
1427 // auto-initialization of debug loggers
1429 if( impl == Log::Get()->impl
1430 && impl->domains->CountLoggers() == 0
1431 && Log::DebugLogger == nullptr )
1432 Log::AddDebugLogger( Log::Get() );
1435 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX", "ALox (ALib) was not properly bootstrapped.
" )
1437 ++impl->CntLogCalls;
1439 if ( impl->domains->CountLoggers() == 0 )
1443 evaluateResultDomain( impl, domain ),
1445 *impl->logableContainers[size_t(impl->CountAcquirements() - 1)],
1446 lang::Inclusion::Include );
1449int LI::IsActive( LoxImpl* impl, Verbosity verbosity, const NString& domain )
1453 // auto-initialization of debug loggers
1455 if( impl == Log::Get()->impl
1456 && impl->domains->CountLoggers() == 0
1457 && Log::DebugLogger == nullptr )
1458 Log::AddDebugLogger( Log::Get() );
1461 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX
", "ALox (ALib) was not properly bootstrapped.
" )
1463 if ( impl->domains->CountLoggers() == 0 )
1466 Domain* dom= evaluateResultDomain( impl, domain );
1469 for ( int i= 0; i < dom->CountLoggers() ; ++i )
1470 if( dom->IsActive( i, verbosity ) )
1475void LI::IncreaseLogCounter( LoxImpl* impl)
1477 ++impl->CntLogCalls;
1480void LI::entryDetectDomainImpl(LoxImpl* impl, Verbosity verbosity )
1482 BoxesMA& logables= *impl->logableContainers[size_t(impl->CountAcquirements() - 1)];
1483 if ( logables.Size() > 1 && logables[0].IsArrayOf<nchar>() )
1485 NString firstArg= logables[0].Unbox<NString>();
1487 // accept internal domain at the start
1489 if( firstArg.StartsWith( Lox::InternalDomains ) )
1490 idx+= Lox::InternalDomains.Length();
1492 // loop over domain and check for illegal characters
1493 bool illegalCharacterFound= false;
1494 for( ; idx< firstArg.Length() ; ++idx )
1496 char c= firstArg[idx];
1497 if (! ( isdigit( c )
1498 || ( c >= 'A' && c <= 'Z' )
1505 illegalCharacterFound= true;
1510 if ( illegalCharacterFound )
1512 Entry( impl, nullptr, verbosity );
1516 logables.erase( logables.begin() );
1517 Entry( impl, firstArg, verbosity );
1521 Entry( impl, nullptr, verbosity );
1525// #################################################################################################
1527// #################################################################################################
1528Domain* LI::evaluateResultDomain(LoxImpl* impl, const NString& domainPath )
1530 NString128 resDomain;
1532 // 0. internal domain tree?
1533 if ( domainPath.StartsWith( Lox::InternalDomains ) )
1535 // cut "$/
" from the path
1536 resDomain._( domainPath, Lox::InternalDomains.Length() );
1537 return findDomain( impl, *impl->internalDomains, resDomain );
1541 NString64 localPath; localPath.DbgDisableBufferReplacementWarning();
1542 impl->scopeDomains.InitWalk( Scope::ThreadInner,
1543 // we have to provide NULL_STRING if parameter is empty
1544 domainPath.IsNotEmpty() ? localPath._(domainPath)
1547 NString nextDefault;
1548 while( (nextDefault= impl->scopeDomains.Walk() ).IsNotNull() )
1550 ALIB_ASSERT( nextDefault.IsNotEmpty() )
1552 if ( resDomain.IsNotEmpty() )
1553 resDomain.InsertAt( "/
", 0);
1554 resDomain.InsertAt( nextDefault, 0 );
1556 // absolute path? That's it
1557 if ( resDomain.CharAtStart() == Domain::Separator() )
1560 return findDomain( impl, *impl->domains, resDomain );
1563void LI::getVerbosityFromConfig(LoxImpl* impl, Variable& v, Logger* logger, Domain& dom )
1565 // get logger number. It may happen that the logger is not existent in this domain tree.
1566 int loggerNo= dom.GetLoggerNo( logger ) ;
1570 auto& cvVerb = v.Get<alib::lox::CVVerbosities>();
1572 for (auto it : cvVerb)
1574 Tokenizer verbosityTknzr( it, '=' );
1576 NString256 domainStrBuf;
1577 Substring domainStrParser= verbosityTknzr.Next();
1578 if ( domainStrParser.ConsumeString<lang::Case::Ignore>( A_CHAR("INTERNAL_DOMAINS
")) )
1580 while ( domainStrParser.ConsumeChar('/') )
1582 domainStrBuf << Lox::InternalDomains << domainStrParser;
1585 domainStrBuf._( domainStrParser );
1587 NSubstring domainStr= domainStrBuf ;
1589 Substring verbosityStr= verbosityTknzr.Next();
1590 if ( verbosityStr.IsEmpty() )
1594 if ( domainStr.ConsumeChar ( '*' ) ) searchMode+= 2;
1595 if ( domainStr.ConsumeCharFromEnd( '*' ) ) searchMode+= 1;
1596 if( ( searchMode == 0 && dom.FullPath.Equals <NC ,lang::Case::Ignore>( domainStr ) )
1597 || ( searchMode == 1 && dom.FullPath.StartsWith<CHK,lang::Case::Ignore>( domainStr ) )
1598 || ( searchMode == 2 && dom.FullPath.EndsWith <CHK,lang::Case::Ignore>( domainStr ) )
1599 || ( searchMode == 3 && dom.FullPath.IndexOf <CHK,lang::Case::Ignore>( domainStr ) >=0 )
1602 Verbosity verbosity(Verbosity::Info);
1603 enums::Parse<Verbosity>(verbosityStr, verbosity );
1604 dom.SetVerbosity( loggerNo, verbosity, v.GetPriority() );
1609 ._<
NC>(
'\'' )._<NC>( dom.FullPath )
1611 ._(
"= Verbosity::" )
1612 ._( std::make_pair(verbosity, dom.GetPriority( loggerNo )) ).TrimEnd()
1632 if( !variable.
Try(decl) )
1637 prefixTokOuter.
Set(variable,
';',
true);
1638 while(prefixTokOuter.
HasNext())
1651 domainStrBuf.
_( domainStrParser );
1663 prefixTokInner.
Next();
1664 if ( prefixTokInner.
Actual.IsNotEmpty() )
1668 if ( domainStr.
ConsumeChar (
'*' ) ) searchMode+= 2;
1679 NString128 msg; msg.
_<
NC>(
"String \"" )._<NC>( prefixStr )._<
NC>(
"\" added as prefix logable for domain \'" )
1681 ._<
NC>(
"\'. (Retrieved from configuration variable \'" )._<NC>(variable)._(
"\'.)" );
1683 logInternal( impl, Verbosity::Info,
"PFX", msg );
1691 getVerbosityFromConfig( impl, varVerbosities, logger, dom );
1695 getAllVerbosities( impl, varVerbosities, logger, subDomain );
1701 int maxSubstitutions= 10;
1710 dom= rootDomain.
Find( domainPath, 1, &wasCreated );
1718 BoxesMA& logables= acquireInternalLogables(impl);
1719 logables.
Add(
"{!Q} registered.", dom->
FullPath );
1720 logInternal( impl, Verbosity::Info,
"DMN", logables );
1728 Box replacements[2];
1732 replacements[0]= GetName( impl );
1733 replacements[1]= logger->
GetName();
1736 varVerbosities.
Declare( Variables::VERBOSITY, replacements ); }
1738 getVerbosityFromConfig( impl, varVerbosities, logger, *dom );
1742 getDomainPrefixFromConfig( impl, *dom );
1748 logInternal( impl, Verbosity::Verbose,
"DMN",
" No loggers set, yet." );
1757 logInternal( impl, Verbosity::Verbose,
"DMN", msg );
1773 while( maxSubstitutions-- > 0 )
1776 bool substituted=
false;
1781 case DomainSubstitutionRule::Type::StartsWith:
1786 substPath.
_( rule.Replacement ).
_( domFullPath, rule.Search.
Length() );
1802 case DomainSubstitutionRule::Type::EndsWith:
1805 if ( domFullPath.
EndsWith( rule.Search ) )
1807 substPath.
_( domFullPath, 0, domFullPath.
Length() - rule.Search.Length() ).
_( rule.Replacement );
1814 if ( substPath.
EndsWith( rule.Search ) )
1816 substPath.
DeleteEnd( rule.Search.Length() ).
_( rule.Replacement );
1824 case DomainSubstitutionRule::Type::Substring:
1831 substPath.
_( domFullPath, 0, idx ).
_( rule.Replacement).
_( domFullPath, idx + rule.Search.
Length() );
1850 case DomainSubstitutionRule::Type::Exact:
1854 if ( domFullPath.
Equals<
NC>( rule.Search ) )
1856 substPath.
_( rule.Replacement);
1862 substPath.
_( rule.Replacement);
1869 if ( substPath.
Equals<
NC>( rule.Search) )
1871 substPath.
Reset( rule.Replacement );
1879 default:
ALIB_ERROR(
"Illegal switch state.")
break;
1890 if ( maxSubstitutions <= 0 && !impl->oneTimeWarningCircularDS )
1893 logInternal( impl, Verbosity::Error,
"DMN",
1894 "The Limit of 10 domain substitutions was reached. Circular substitution assumed!"
1895 " (This error is only reported once!)" );
1899 if( substPath.
Length() > 0 )
1901 domainPath= substPath;
1913 if ( scope > Scope::Path )
1915 pathLevel= UnderlyingIntegral( scope - Scope::Path );
1923 BoxesMA& logables= acquireInternalLogables(impl);
1924 logables.
Add(
"Missing scope information. Cant use {}.", (scope + pathLevel) );
1925 logInternal( impl, Verbosity::Error, internalDomain, logables );
1934 if ( scope == Scope::ThreadOuter
1935 || scope == Scope::ThreadInner )
1938 BoxesMA& logables= acquireInternalLogables(impl);
1939 logables.
Add(
"Illegal parameter, only Scope::ThreadOuter and Scope::ThreadInner allowed."
1940 " Given: {}.", scope );
1941 logInternal( impl, Verbosity::Error,
"DMN", logables );
1950 #elif ALIB_EXT_LIB_THREADS_AVAILABLE
1955 "Illegal parameter, only Scope::ThreadOuter and Scope::ThreadInner allowed." );
1964 bool logablesCollected=
false;
1967 if( dom->
IsActive( i, verbosity ) )
1970 if ( !logablesCollected )
1972 logablesCollected=
true;
1973 impl->
scopePrefixes.InitWalk( Scope::ThreadInner, &marker );
1975 int userLogablesSize=
static_cast<int>( logables.
Size() );
1976 int threadInnersSize= -1;
1980 if( next != &marker )
1990 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1991 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1992 (*boxes)[
size_t(pfxI)] );
1997 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1998 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1999 (*boxes)[
size_t(pfxI)] );
2004 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
2005 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
2006 (*boxes)[
size_t(pfxI)] );
2009 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ), *next );
2016 bool excludeOthers=
false;
2017 threadInnersSize=
static_cast<int>( logables.
Size() ) - userLogablesSize;
2019 while ( pflDom !=
nullptr )
2028 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
2029 logables.emplace( logables.begin(),
2030 (*boxes)[
size_t(pfxI)] );
2035 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
2036 logables.emplace( logables.begin(),
2037 (*boxes)[
size_t(pfxI)] );
2042 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
2043 logables.emplace( logables.begin(),
2044 (*boxes)[
size_t(pfxI)] );
2047 logables.emplace( logables.begin(), prefix );
2052 excludeOthers=
true;
2057 pflDom= excludeOthers ? nullptr : pflDom->
Parent;
2063 for (
int ii= 0; ii < threadInnersSize ; ++ii )
2064 logables.pop_back();
2074 logger->
Log( *dom, verbosity, logables, impl->
scopeInfo );
2101 BoxesMA& logables= acquireInternalLogables(impl);
2102 logables.
Add( msg );
2103 logInternal( impl, verbosity, subDomain, logables );
2115 buf.
InsertChars(
' ', maxDomainPathLength + 5 - idx + reference, idx);
2120 getStateDomainRecursive( subDomain, maxDomainPathLength, buf );
2123void getStateDomainsWithDiffVerb(
Domain& dom,
int loggerNo, std::vector<Domain*>& results );
2124void getStateDomainsWithDiffVerb(
Domain& dom,
int loggerNo, std::vector<Domain*>& results )
2126 if ( dom.
Parent ==
nullptr
2128 results.emplace_back( &dom );
2131 getStateDomainsWithDiffVerb( it, loggerNo, results );
2134void getStateCollectPrefixes( Domain& dom,
integer indentSpaces,
NAString& target );
2135void getStateCollectPrefixes( Domain& dom,
integer indentSpaces,
NAString& target )
2138 for (
auto& pfl : dom.PrefixLogables )
2143 buffer.
_( *
static_cast<Box*
>(pfl.first) );
2148 buffer.
_<
NC>(
" (Excl.)" );
2150 buffer.
_<
NC>(
"<domain> [" )._<NC>( dom.FullPath )._<
NC>(
']').NewLine();
2154 for(
auto& subDom : dom.SubDomains )
2155 getStateCollectPrefixes( subDom, indentSpaces, target );
2170 if ( HasBits( flags, StateInfo::CompilationFlags ) )
2174 buf.
_<
NC>(
"ALib Compiler Symbols:" ).NewLine();
2189 if( alib::HasBits( flags, StateInfo::Basic ) )
2192 if( HasBits( flags, StateInfo::Version ) )
2198 if( HasBits( flags, StateInfo::Basic ) )
2199 buf.
_<
NC>(
"#Log Calls: " )._<NC>( impl->
CntLogCalls ).NewLine();
2201 if( HasBits( flags, StateInfo::Basic )
2202 || HasBits( flags, StateInfo::Version ) )
2206 if( HasBits( flags, StateInfo::SPTR ) )
2208 buf.
_<
NC>(
"Source Path Trimming Rules: " ).NewLine();
2212 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo )
2215 std::vector<ScopeInfo::SourcePathTrimRule>* trimInfoList=
2216 trimInfoNo == 0 ? &ScopeInfo::GlobalSPTRs
2221 for (
auto& ti : *trimInfoList )
2224 buf.
_<
NC>( trimInfoNo == 0 ?
" Global: "
2226 buf.
_<
NC>( ti.IsPrefix ?
"\"" :
"\"*");
2227 buf.
_<
NC>( ti.Path )._<NC>(
"\", " );
2228 buf.
_<
NC>( ti.IncludeString );
2229 if ( ti.TrimOffset != 0 )
2230 buf.
_<
NC>( ti.Path )._<NC>(
"\", Offset: " )._<
NC>( ti.TrimOffset );
2231 buf.
_<
NC>(
", Priority: " )._( ti.Priority );
2238 buf.
_<
NC>(
" <no rules set>" ).NewLine();
2243 if( HasBits( flags, StateInfo::DSR ) )
2245 buf.
_<
NC>(
"Domain Substitution Rules: " ).NewLine();
2251 if ( maxWidth < it.Search.Length() )
2252 maxWidth = it.Search.Length();
2259 if ( it.type == DomainSubstitutionRule::Type::EndsWith
2260 || it.type == DomainSubstitutionRule::Type::Substring )
2263 buf.
_<
NC>( it.Search );
2264 if ( it.type == DomainSubstitutionRule::Type::StartsWith
2265 || it.type == DomainSubstitutionRule::Type::Substring )
2270 ._<
NC>( it.Replacement );
2275 buf.
_<
NC>(
" <no rules set>" ).NewLine();
2280 if( HasBits( flags, StateInfo::Once ) )
2282 buf.
_<
NC>(
"Once() Counters: " ).NewLine();
2283 if ( scopeDump.writeStoreMap( &impl->
scopeLogOnce ) == 0 )
2284 buf.
_<
NC>(
" <no Once() counters set>" ).NewLine();
2289 if( HasBits( flags, StateInfo::LogData ) )
2291 buf.
_<
NC>(
"Log Data: " ).NewLine();
2292 if ( scopeDump.writeStoreMap( &impl->
scopeLogData ) == 0 )
2293 buf.
_<
NC>(
" <no data objects stored>" ).NewLine();
2298 if( HasBits( flags, StateInfo::PrefixLogables ) )
2300 buf.
_<
NC>(
"Prefix Logables: " ).NewLine();
2303 getStateCollectPrefixes( *impl->
domains, 2, buf );
2304 if ( oldLength == buf.
Length() )
2305 buf.
_<
NC>(
" <no prefix logables set>" ).NewLine();
2310 if( HasBits( flags, StateInfo::ThreadMappings ) )
2313 buf.
_<
NC>(
"Named Threads: " ).NewLine();
2315 buf.
_<
NC>(
" <no thread name mappings set>" ).NewLine();
2320 <<
'\"' << pair.second <<
'\"';
2328 if( HasBits( flags, StateInfo::ScopeDomains ) )
2330 buf.
_<
NC>(
"Scope Domains: " ).NewLine();
2331 if ( scopeDump.writeStore( &impl->
scopeDomains, 2 ) == 0 )
2332 buf.
_<
NC>(
" <no scope domains set>" ).NewLine();
2337 if( HasBits( flags, StateInfo::Loggers ) )
2340 std::vector<Domain*> domainsWithDiffVerb;
2341 for (
int treeNo= 0; treeNo < 2; ++treeNo )
2348 buf.
_<
NC>(
"Loggers:" ).NewLine();
2353 buf.
_<
NC>(
"Loggers on Internal Domains:" ).NewLine();
2356 for (
int loggerNo= 0; loggerNo< domTree->
CountLoggers(); ++loggerNo )
2363 buf.
_<
NC>(
" " )._<NC>( *logger ).NewLine();
2364 buf.
_<
NC>(
" Lines logged: " )._<NC>( logger->
CntLogs ).NewLine();
2367 buf.
_<
NC>(
" Creation time: " )._<NC>( ct.
Format(
A_CHAR(
"yyyy-MM-dd HH:mm:ss"), as64.
Reset()) ).NewLine();
2370 buf.
_<
NC>(
" Last log time: " )._<NC>( ct.
Format(
A_CHAR(
"yyyy-MM-dd HH:mm:ss"), as64.
Reset()) ).NewLine();
2372 domainsWithDiffVerb.clear();
2373 getStateDomainsWithDiffVerb( *domTree, loggerNo, domainsWithDiffVerb);
2374 for (
Domain* dom : domainsWithDiffVerb )
2377 ._( dom == *domainsWithDiffVerb.begin() ?
"Verbosities: "
2383 buf <<
"= " << std::make_pair(dom->GetVerbosity( loggerNo ), dom->GetPriority(loggerNo) )
2388 buf.
_<
NC>(
" <no loggers attached>" ).NewLine();
2394 if( HasBits( flags, StateInfo::InternalDomains ) )
2396 buf.
_<
NC>(
"Internal Domains:" ).NewLine();
2402 if( HasBits( flags, StateInfo::Domains ) )
2404 buf.
_<
NC>(
"Domains:" ).NewLine();
2421 variable.
Declare(Variables::CONSOLE_TYPE );
2428 val.
Equals<
NC, lang::Case::Ignore>(
A_CHAR(
"Default") ) )
goto DEFAULT;
2434 #if defined( _WIN32 )
2439 ALIB_WARNING(
"ALOX",
"Unrecognized value in config variable {!Q} = {!Q}.",
2443 if( variable.
Define(config::Priority::Standard) )
2446 #if defined( _WIN32 )
2460#undef UNDEFINED_THREAD
2461#undef ASSERT_ACQUIRED
integer UnboxLength() const
decltype(std::declval< typename TFDecl::Signature >()(std::declval< Box & >(), std::declval< TArgs >()...)) Call(TArgs &&... args) const
const TUnboxable Unbox() const
ALIB_API const Declaration * StoreDeclaration(const Declaration *orig, const Box &replacements)
static const Declaration * Get(TEnum element)
ALIB_API Variable & Declare(const String &name, const String &typeName, const String &defaultValue=NULL_STRING)
bool Try(const String &name)
ALIB_API bool Define(Priority requestedPriority=Priority::Standard)
integer Erase(const KeyType &key)
integer Size() const noexcept
std::pair< Iterator, bool > EmplaceOrAssign(const KeyType &key, TArgs &&... args)
Iterator InsertUnique(const StoredType &value)
Iterator Find(const KeyType &key)
threads::SharedLock & GetConfigLock()
config::Configuration & GetConfig()
ALIB_API void DoReport(Message &message)
static Report & GetDefault()
ALIB_API void Set(const DateTime &timeStamp, lang::Timezone timezone=lang::Timezone::Local)
ALIB_API AString & Format(Substring format, AString &target, lang::CurrentData targetData=lang::CurrentData::Keep) const
ALIB_API void Register(Lox *lox, lang::ContainerOp operation)
ALIB_API Lox * Get(const NString &name, lang::CreateIfNotExists create=lang::CreateIfNotExists::No)
static ALIB_API void ReplaceToReadable(AString &target, integer startIdx)
static ALIB_API void RemoveDebugLogger(Lox *lox)
static ALIB_API textlogger::TextLogger * DebugLogger
The debug logger created by AddDebugLogger.
static ALIB_FORCE_INLINE Lox * Get()
This class acts as a container for Loggers and provides a convenient interface to logging.
detail::LoxImpl * impl
The implementation.
static constexpr NString InternalDomains
const NString & GetName()
Verbosity GetVerbosity(int loggerNo)
bool ConfigurationAlreadyRead
Flag which is set when verbosity configuration data was read.
Domain * Parent
The parent domain. For root domains, this is nullptr.
ALIB_API Verbosity SetVerbosity(int loggerNo, Verbosity verbosity, Priority priority)
int AddLogger(detail::Logger *logger)
void ToString(NAString &target)
NString FullPath
The full path of the domain (set in the constructor once) .
bool IsActive(int loggerNo, Verbosity statement)
List< PoolAllocator, std::pair< PrefixLogable *, lang::Inclusion >, Recycling::None > PrefixLogables
Prefix Logables associated with this domain.
void RemoveLogger(int loggerNo)
Priority GetPriority(int loggerNo)
int GetLoggerNo(const NString &loggerName)
detail::Logger * GetLogger(const NString &loggerName)
List< MonoAllocator, Domain, Recycling::None > SubDomains
A list of subdomains, sorted by name.
ALIB_API Domain * Find(NSubstring domainPath, int maxCreate, bool *wasCreated)
virtual void AcknowledgeLox(LoxImpl *lox, lang::ContainerOp op)
const NString & GetName() const
time::Ticks TimeOfCreation
The creation time of the Logger.
time::Ticks TimeOfLastLog
Timestamp of the last log operation.
virtual void Log(Domain &dom, Verbosity verbosity, BoxesMA &logables, ScopeInfo &scope)=0
NString loxName
The name of the Lox we are attached to.
const NCString & GetOrigFile()
std::vector< SourcePathTrimRule > LocalSPTRs
List of trim definitions for portions of source paths to be ignored.
const NString GetFullPath()
const NString GetFileName()
void SetFileNameCacheCapacity(integer numberOfLists, integer entriesPerList)
ThreadDictionary threadDictionary
std::thread::id GetThreadNativeID()
const NCString GetMethod()
ALIB_API void Set(const lang::CallerInfo &ci)
void PopNestedScope()
Releases latest scope information.
ALIB_API void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
const NString GetLoxName()
const std::type_info * GetTypeInfo()
TickConverter DateConverter
ALIB_API void Reset(Snapshot snapshot=Snapshot())
static ALIB_API TMonoAllocator * Create(const char *dbgName, lang::HeapAllocator &pAllocator, size_t initialBufferSizeInKB, unsigned int bufferGrowthInPercent=200)
TAString & DeleteEnd(integer regionLength)
TAString & ReplaceSubstring(const TString< TChar > &src, integer regionStart, integer regionLength)
TAString & InsertChars(TChar c, integer qty)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
ALIB_API TAString & Trim(const TCString< TChar > &trimChars=TT_CStringConstants< TChar >::DefaultWhitespaces())
void DbgDisableBufferReplacementWarning()
ALIB_API void SetBuffer(integer newCapacity)
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsEmpty() const
constexpr bool IsNotEmpty() const
constexpr integer Length() const
TChar CharAtStart() const
constexpr bool IsNotNull() const
TString< TChar > Substring(integer regionStart, integer regionLength=MAX_LEN) const
bool Equals(const TString< TChar > &rhs) const
void Free(TAllocator &allocator)
bool EndsWith(const TString &needle) const
bool StartsWith(const TString &needle) const
bool ConsumeString(const TString< TChar > &consumable)
integer ConsumePartOf(const TString< TChar > &consumable, int minChars=1)
bool ConsumeCharFromEnd(TChar consumable)
TSubstring & Trim(const TCString< TChar > &whiteSpaces=TT_CStringConstants< TChar >::DefaultWhitespaces())
ALIB_API TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
TSubstring< TChar > Actual
void Set(const TString< TChar > &src, TChar delimiter, bool skipEmptyTokens=false)
DbgLockAsserter Dbg
The debug tool instance.
ALIB_API void AcquireRecursive(ALIB_DBG_TAKE_CI)
ALIB_API void ReleaseRecursive(ALIB_DBG_TAKE_CI)
static Thread * GetCurrent()
virtual const CString GetName() const
static ALIB_API DateTime FromFileTime(const FILETIME &fileTime)
static DateTime FromEpochSeconds(time_t epochSeconds)
Ticks ToTicks(DateTime dateTime)
DateTime ToDateTime(Ticks ticks)
void SetAs(const TDerived &other)
#define ALIB_WARNING(...)
#define ALIB_LOCK_SHARED_WITH(lock)
#define IF_ALIB_THREADS(...)
#define ALIB_WARNINGS_RESTORE
#define ALIB_LOCK_RECURSIVE_WITH(lock)
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_ASSERT_WARNING(cond,...)
#define ALIB_CALLER_PRUNED
#define ALIB_LOCK_WITH(lock)
#define ALIB_REL_DBG(releaseCode,...)
#define ALIB_CHARACTERS_WIDE
bool Parse(strings::TSubstring< TChar > &input, TEnum &result)
bool ParseEnumOrTypeBool(strings::TSubstring< TChar > &input, TEnum &result, TEnum falseValue, TEnum trueValue)
static ALIB_FORCE_INLINE void Destruct(T &object)
Inclusion
Denotes how members of a set something should be taken into account.
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
@ Trim
Trim whitespaces away.
@ On
Switch it on, switched on, etc.
Reach
Denotes the reach of something.
@ Global
Denotes global reach.
Case
Denotes upper and lower case character treatment.
@ Left
Chooses left alignment.
@ Remove
Denotes removals.
@ Insert
Denotes insertions.
@ VERBOSITY
Denotes configuration variable ALOX/LOGGERNAME/VERBOSITY_WITH_LOXNAME.
@ DOMAIN_SUBSTITUTION
Denotes configuration variable ALOX/LOXNAME/DOMAIN_SUBSTITUTION used by class Lox.
@ DUMP_STATE_ON_EXIT
Denotes configuration variable ALOX/LOXNAME/DUMP_STATE_ON_EXIT used by class Lox.
integer ThreadID
The ALib thread identifier type.
lox::ALoxCamp ALOX
The singleton instance of ALib Camp class ALoxCamp.
NLocalString< 128 > NString128
Type alias name for TLocalString<nchar,128>.
CompilationFlagMeaningsEntry COMPILATION_FLAG_MEANINGS[37]
constexpr NString NULL_NSTRING
A nulled string of the narrow character type.
lang::basecamp::BaseCamp BASECAMP
The singleton instance of ALib Camp class BaseCamp.
std::vector< T, SCAMono< T > > StdVectorMono
Type alias in namespace alib.
strings::TString< nchar > NString
Type alias in namespace alib.
LocalString< 32 > String32
Type alias name for TLocalString<character,32>.
constexpr CString NEW_LINE
A zero-terminated string containing the new-line character sequence.
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
time::TickConverter TickConverter
Type alias in namespace alib.
LocalString< 256 > String256
Type alias name for TLocalString<character,256>.
boxing::Box Box
Type alias in namespace alib.
LocalString< 128 > String128
Type alias name for TLocalString<character,128>.
void DbgAssertSingleThreaded()
lang::integer integer
Type alias in namespace alib.
ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE TCompilationFlags COMPILATION_FLAGS
threads::ThreadID ThreadID
Type to store thread identifiers.
unsigned char bits[6]
The Flags.
integer Add(const strings::TString< TChar > &src)
void Clear()
Frees all allocated strings and clears vector.
Domain substitution rules.
@ EndsWith
Ends with match.
@ Substring
Any substring.
@ StartsWith
Starts with match.
NString32 Replacement
The replacement.
DomainSubstitutionRule(const NString &s, const NString &r)
NString32 Search
The path to search.
static ALIB_API void Reset(LoxImpl *impl)
static ALIB_API void writeVerbositiesOnLoggerRemoval(LoxImpl *impl, Logger *logger)
static ALIB_API void SetVerbosity(LoxImpl *impl, detail::Logger *logger, Verbosity verbosity, const NString &domain, Priority priority)
static ALIB_API void SetStartTime(LoxImpl *impl, Ticks startTime, const NString &loggerName)
static ALIB_API void Acquire(LoxImpl *impl, const lang::CallerInfo &ci)
static ALIB_API void SetDomainSubstitutionRule(LoxImpl *impl, const NString &domainPath, const NString &replacement)
static ALIB_API void setDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, bool removeNTRSD, threads::Thread *thread)
static ALIB_API detail::Logger * GetLogger(LoxImpl *impl, const NString &loggerName)
static ALIB_API void SetFileNameCacheCapacity(LoxImpl *impl, integer numberOfLists, integer entriesPerList)
static ALIB_API void getAllVerbosities(LoxImpl *impl, config::Variable &variable, detail::Logger *logger, detail::Domain &dom)
static ALIB_API void RemoveThreadDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
static ALIB_API detail::Domain * evaluateResultDomain(LoxImpl *impl, const NString &domainPath)
static ALIB_API int checkScopeInformation(LoxImpl *impl, Scope &scope, const NString &internalDomain)
static ALIB_API bool RemoveLogger(LoxImpl *impl, detail::Logger *logger)
static ALIB_API void init(LoxImpl *impl)
static ALIB_API void store(LoxImpl *impl, const Box &data, const NString &pKey, Scope scope)
static ALIB_API void Release(LoxImpl *impl)
static ALIB_API bool isThreadRelatedScope(LoxImpl *impl, Scope scope)
static ALIB_API void Construct(Lox *lox, const NString &name, bool doRegister)
static ALIB_API BoxesMA & acquireInternalLogables(LoxImpl *impl)
static ALIB_API void logInternal(LoxImpl *impl, Verbosity verbosity, const NString &subDomain, BoxesMA &msg)
static ALIB_API void setPrefix(LoxImpl *impl, const Box &prefix, Scope scope, threads::Thread *thread)
static ALIB_API void GetState(LoxImpl *impl, NAString &buf, StateInfo flags)
static ALIB_API void MapThreadName(LoxImpl *impl, const String &threadName, threads::ThreadID id)
static ALIB_API void State(LoxImpl *impl, const NString &domain, Verbosity verbosity, const String &headLine, StateInfo flags)
static ALIB_API void dumpStateOnLoggerRemoval(LoxImpl *impl)
static ALIB_API void Destruct(Lox *lox)
static ALIB_API Box retrieve(LoxImpl *impl, const NString &pKey, Scope scope)
static ALIB_API integer & GetLogCounter(LoxImpl *impl)
static ALIB_API const NString & GetName(LoxImpl *impl)
static ALIB_API void SetDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
static ALIB_API void Entry(LoxImpl *impl, const NString &domain, Verbosity verbosity)
static ALIB_API MonoAllocator & DbgGetMonoAllocator(LoxImpl *impl)
static ALIB_API void once(LoxImpl *impl, const NString &domain, Verbosity verbosity, const Box &logables, const String &pGroup, Scope scope, int quantity)
static ALIB_API BoxesMA & GetLogableContainer(LoxImpl *impl)
static ALIB_API threads::RecursiveLock & getLock(LoxImpl *impl)
static ALIB_API void SetPrefix(LoxImpl *impl, const Box &prefix, const NString &domain, lang::Inclusion otherPLs)
static ALIB_API void SetSourcePathTrimRule(LoxImpl *impl, const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
int CountAcquirements() const noexcept
monomem::Snapshot beforeLox
Snapshot taken before embedding the lox in the monoAllocator.
StdVectorMono< BoxesMA * > logableContainers
A list of a list of logables used for (recursive) logging.
int AcquirementsCount
Counts the number of nested (recursive) acquirements.
StdVectorMono< BoxesMA * > internalLogables
A list of a list of logables used for (recursive) internal logging.
bool oneTimeWarningCircularDS
Flag if a warning on circular rule detection was logged.
T * newPO(TArgs &&... args)
Domain * internalDomains
The root domain for internal Log Domains.
threads::RecursiveLock Lock
A mutex to control parallel access.
ScopeInfo scopeInfo
Information about the source code, method, thread, etc. invoking a log call.
LoxImpl(MonoAllocator *ma, const NString &name)
ScopeStore< NString, true > scopeDomains
Scope Domains.
ScopeStore< PrefixLogable *, true > scopePrefixes
Prefix logables store.
List< MonoAllocator, DomainSubstitutionRule > domainSubstitutions
The list of domain substitution rules.
integer maxLoggerNameLength
Used for tabular output of logger lists.
const NString noKeyHashKey
A key value used in stores if no key is given (global object).
ScopeStore< SSMap< int > *, false > scopeLogOnce
Log once counters.
MonoAllocator & monoAllocator
The self contained monotonic allocator, that also contains this struct itself.
PoolAllocator poolAllocator
A pool allocator that uses monoAllocator as its source.
ScopeStore< SSMap< Box > *, false > scopeLogData
Log data store.
integer maxDomainPathLength
Used for tabular output of logger lists.
integer internalLogRecursionCounter
The recursion counter for internal logging.
bool loggerAddedSinceLastDebugState
Flag used with configuration variable LOXNAME_DUMP_STATE_ON_EXIT.