2#if !ALIB_SINGLE_THREADED
3# define UNDEFINED_THREAD threads::UNDEFINED
5# define UNDEFINED_THREAD 0
37 Search .DbgDisableBufferReplacementWarning();
60 Search._( s, startPos, length );
65 &&
Search.CharAtStart() !=
'/'
68 &&
Search.CharAtEnd() ==
'/'
93 #if !ALIB_SINGLE_THREADED
180 for (
int i=
domains->CountLoggers() - 1 ; i >= 0 ; --i ) {
207 template<
typename T,
typename... TArgs>
219#define ASSERT_ACQUIRED ALIB_ASSERT_ERROR( impl->CountAcquirements() >0,"ALOX","Lox not acquired" )
230 LoxImpl* result= (*selfContainedMA)().New<LoxImpl>( selfContainedMA, name );
245#if !ALIB_SINGLE_THREADED
254 #if !ALIB_SINGLE_THREADED
267 #if !ALIB_SINGLE_THREADED
280 const NString internalDomainList[]= {
"LGR",
"DMN",
"PFX",
"THR",
"LGD",
"VAR" };
281 for (
auto& it : internalDomainList )
298 for(
int ruleNo= 0 ; ruleNo < var.
Size() ; ++ruleNo ) {
310 ALIB_WARNING(
"ALOX",
"Syntax error in variable \"{}\".", var )
332 (*loxMA)().Delete(impl);
333 loxMA->
Reset(snapshot);
335 (*loxMA)().New<LoxImpl>(loxMA, name );
337 ALIB_ASSERT_ERROR( impl == dbgNewAddress,
"ALOX",
"Internal error. This must never happen." )
353 const NString& trimReplacement,
358 trimReplacement, reach, priority );
365 setDomain( impl, scopeDomain, scope,
false, thread );
376 if ( (logger= impl->
domains ->
GetLogger( loggerName ) ) !=
nullptr )
return logger;
381 logables.
Add(
"No logger named {!Q} found.", loggerName );
382 logInternal( impl, Verbosity::Warning,
"LGR", logables );
391 if( parentVerbosity != verbosity || verbosities.
ExportAll )
396 writeVerbVarRecursive( subDomain, loggerNo, verbosities, verbosity );
402DOX_MARKER([DOX_VARIABLES_REPLACEMENTS2])
415DOX_MARKER( [DOX_VARIABLES_REPLACEMENTS2])
426 if ( loggerNoMainDom >= 0 ) writeVerbVarRecursive( *impl->
domains , loggerNoMainDom, cvVerb,
Verbosity(-1) );
438 logables.
Add(
"Verbosities for logger {!Q} written to variable {!Q}",
440 logInternal( impl, Verbosity::Info,
"VAR", logables );
446 logables.
Add(
" Value:");
447 for(
auto& it : cvVerb )
448 logables.
Add(
"\n ", it );
449 logInternal( impl, Verbosity::Verbose,
"VAR", logables );
472 tknzr.
Set(variable,
',',
true);
507 logables.
Add(
"Unknown argument {!Q} in variable {} = {!Q}.",
509 logInternal( impl, Verbosity::Error,
"VAR", logables);
513 State( impl, domain, verbosity,
A_CHAR(
"Auto dump state on exit requested: "), flags );
523 if( noMainDom >= 0 || noIntDom >= 0 ) {
540 logables.
Add(
"Logger {!Q} not found. Nothing removed.", logger );
541 logInternal( impl, Verbosity::Warning,
"LGR", logables );
551 if( noMainDom >= 0 || noIntDom >= 0 ) {
567 logables.
Add(
"Logger {!Q} removed.", logger );
568 logInternal( impl, Verbosity::Info,
"LGR", logables );
574 logables.
Add(
"Logger {!Q} not found. Nothing removed.", loggerName );
575 logInternal( impl, Verbosity::Warning,
"LGR", logables );
584 if ( logger ==
nullptr ) {
586 logables.
Add(
"Given Logger is \"null\". Verbosity not set." );
587 logInternal( impl, Verbosity::Error,
"LGR", logables );
596 bool isNewLogger=
false;
604 .Add(
"Unable to add logger {!Q}. Logger with same name exists.", logger ) );
609 " Request was: SetVerbosity({!Q}, {!Q}, Verbosity::{}, {}). ",
610 logger, dom->
FullPath, verbosity, priority ) );
614 .Add(
" Existing Logger: {!Q}.", existingLogger ) );
643 logables.
Add(
"Logger {!Q}.", logger );
645 logables.
Add(
" added for internal log messages.");
647 logables.
Add(
" added.");
648 logInternal( impl, Verbosity::Info,
"LGR", logables );
663 logables.
Add(
"Logger {!Q}: {!Fill}{!Q'}{!Fill}= Verbosity::{}.",
671 if( actVerbosity != verbosity )
672 logables.
Add(
" Lower priority ({} < {}). Remains {}.",
675 logInternal( impl, Verbosity::Info,
"LGR", logables );
687 int no= dom->GetLoggerNo( loggerName );
689 logger= dom->GetLogger( no );
698 logables.
Add(
"Logger not found. Request was: SetVerbosity({!Q}, {!Q}, Verbosity::{}, {}).",
699 loggerName, dom->FullPath, verbosity, priority );
700 logInternal( impl, Verbosity::Warning,
"LGR", logables );
707 SetVerbosity( impl, logger, verbosity, domain, priority );
717 || !verbVar.
Define(priority) )
723 varValue.WriteBack=
true;
749 #if !ALIB_SINGLE_THREADED
750 ThreadID threadID= thread !=
nullptr ? thread->
GetID() : UNDEFINED_THREAD;
758 impl->
scopeDomains.InitAccess( scope, pathLevel, threadID );
760 previousScopeDomain= impl->
scopeDomains.Remove( scopeDomain );
765 trimmable.
Trim() ) );
768 previousScopeDomain= impl->
scopeDomains.Remove(
nullptr );
773 if ( !removeNTRSD && scopeDomain.
IsNotEmpty() ) {
774 logables.
Add(
"{!Q'} set as default for {}.", scopeDomain, (scope + pathLevel) );
776 if ( previousScopeDomain.
IsNull() )
777 logInternal( impl, Verbosity::Info,
"DMN", logables );
779 if ( previousScopeDomain.
Equals<
NC>( scopeDomain ) ) {
780 logables.
Add(
"(Wasalreadyset.)");
781 logInternal( impl,Verbosity::Verbose,
"DMN",logables);
783 logables.
Add(
" Replacing previous default {!Q'}.", previousScopeDomain );
784 logInternal( impl, Verbosity::Warning,
"DMN", logables );
789 logables.
Add(
"{!Q'} removed from {}.", previousScopeDomain, (scope + pathLevel) );
790 logInternal( impl, Verbosity::Info,
"DMN", logables );
793 logables.
Add(
"{!Q'} not found. Nothing removed for {}.", scopeDomain );
795 logables.
Add(
"Empty Scope Domain given, nothing registered for {}.", scopeDomain);
797 logables.
Add( scope + pathLevel);
798 logInternal( impl, Verbosity::Warning,
"DMN", logables );
814 logables.
Add(
"Illegal parameter. No scope domain path given. Nothing removed for {}.",
816 logInternal( impl, Verbosity::Warning,
"DMN", logables );
823 setDomain( impl, scopeDomain, scope,
true, thread);
832 logInternal( impl, Verbosity::Info,
"DMN",
"Domain substitution rules removed.");
841 "Illegal domain substitution rule. Nothing stored." );
848 if ( (*it).type == newRule.
type
849 && (*it).Search.Equals<
NC>( newRule.
Search ) )
857 logables.
Add(
"Domain substitution rule {!Q} not found. Nothing to remove.", domainPath);
858 logInternal( impl, Verbosity::Warning,
"DMN", logables );
862 logables.
Add(
"Domain substitution rule {!Q} -> {!Q} removed.",domainPath,(*it).Replacement);
863 logInternal( impl, Verbosity::Info,
"DMN", logables );
869 logables.
Add(
"Domain substitution rule {!Q} -> {!Q} set.", domainPath, newRule.
Replacement );
874 msg <<
" Replacing previous -> \"" << (*it).Replacement <<
"\".";
881 if(
ALOX.IsBootstrapped() )
882 logInternal( impl, Verbosity::Info,
"DMN", logables );
893 #if !ALIB_SINGLE_THREADED
894 ThreadID threadID= thread !=
nullptr ? thread->
GetID() : UNDEFINED_THREAD;
900 impl->
scopePrefixes.InitAccess( scope, pathLevel, threadID );
901 bool isVoidOrEmpty= prefix.
IsType<
void>()
910 logables.
Add(
"Object ");
911 Verbosity intMsgVerbosity= Verbosity::Info;
912 if ( !isVoidOrEmpty ) {
913 logables.
Add( prefix,
" added as prefix logable for {}.", (scope + pathLevel) );
915 if ( previousLogable !=
nullptr ) {
917 logables.
Add(
" (Same as before.)");
918 intMsgVerbosity= Verbosity::Verbose;
921 logables.
Add(
" Replacing previous {}.", *previousLogable );
924 if ( previousLogable !=
nullptr )
925 logables.
Add(
"{!Q} removed from list of prefix logables for {}.", *previousLogable);
927 logables.
Add(
"<nullptr> given but no prefix logable to remove for {}.");
928 intMsgVerbosity= Verbosity::Warning;
930 logables.
Add( scope + pathLevel );
933 logInternal( impl, intMsgVerbosity,
"PFX", logables );
936 if ( previousLogable !=
nullptr )
948 bool isVoidOrEmpty= prefix.
IsType<
void>()
953 Verbosity intLogVerbosity= Verbosity::Info;
956 if ( !isVoidOrEmpty ) {
958 logables.
Add(
"Object {} added as prefix logable for ", prefix );
962 auto cntPLs= dom->PrefixLogables.size();
964 removedLogable= dom->PrefixLogables.back().first;
965 dom->PrefixLogables.pop_back();
966 logables.
Add(
"Object {} removed from list of prefix logables for",
967 *
static_cast<Box*
>(removedLogable) );
969 logables.
Add(
"No prefix logables to remove for" );
970 intLogVerbosity= Verbosity::Warning;
973 logables.
Add(
" domain {!Q'}.", dom->FullPath);
974 logInternal( impl, intLogVerbosity,
"PFX", logables );
981#if defined (__GLIBCXX__) || defined(_LIBCPP_VERSION) || defined(__APPLE__) || defined(__ANDROID_NDK__)
988#elif defined( _WIN32 )
995 #pragma message "Unknown Platform in file: " __FILE__ )
1001 bool foundOne=
false;
1011 logables.
Add(
"Logger {!Q}: Start time set to ", logger->
GetName() );
1012 if ( !startTime.
IsSet() ) {
1014 logables.
Add(
"'now'" );
1018 if( asTextLogger !=
nullptr )
1022 logables.
Add(
"{:yyyy-MM-dd HH:mm:ss}", asDateTime );
1028 logInternal( impl, Verbosity::Info,
"LGR", logables );
1031 if ( loggerName.
IsNotEmpty() && !foundOne ) {
1033 logables.
Add(
"Logger {!Q}: not found. Start time not set.", loggerName );
1034 logInternal( impl, Verbosity::Error,
"LGR", logables );
1040 #if !ALIB_SINGLE_THREADED
1052 origThreadName=
nullptr;
1059 logables.
Add(
"Mapped thread ID {} to {!Q}.",
id, threadName);
1060 if ( origThreadName.IsNotEmpty() )
1061 logables.
Add(
" Original thread name: {!Q}.", origThreadName );
1062 logInternal( impl, Verbosity::Info,
"THR", logables );
1082 bool groupWasEmtpy= group.
IsEmpty();
1083 if ( groupWasEmtpy ) {
1085 if ( scope == Scope::Global ) {
1086 scope= Scope::Filename;
1096 impl->
scopeLogOnce.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1099 if( map ==
nullptr ) {
1105 auto it= map->
Find( group );
1106 if (it == map->
end() )
1110 if ( quantity >= 0 ) {
1111 if ( it->second < quantity ) {
1116 Entry( impl, domain, verbosity );
1119 if( it->second == quantity ) {
1121 logables.
Add(
"Once() reached limit of {} logs. No further logs for ", quantity );
1123 if ( groupWasEmtpy )
1124 logables.
Add( scope == Scope::Global ?
Box(
"this line" )
1125 :
Box(scope + pathLevel) );
1127 logables.
Add(
"group {!Q}", group );
1128 if ( scope != Scope::Global )
1129 logables.
Add(
" in ", (scope + pathLevel) );
1133 logInternal( impl, Verbosity::Info,
"", logables );
1138 if ( it->second++ % -quantity == 0 ) {
1140 Entry( impl, domain, verbosity );
1147 bool keyWasEmtpy= key.
IsEmpty();
1153 if ( scope > Scope::Path ) {
1154 pathLevel= int( scope - Scope::Path );
1159 impl->
scopeLogData.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1161 if( map ==
nullptr ) {
1169 auto it= map->
Find( key );
1170 if ( !data.
IsType<
void>() ) {
1171 bool replacedPrevious=
false;
1172 if ( it == map->
end() )
1175 replacedPrevious=
true;
1180 logables.
Add(
"Stored data " );
1183 logables.
Add(
" with key {!Q} ", key );
1184 logables.
Add(
"in {}.", (scope + pathLevel) );
1185 if ( replacedPrevious )
1186 logables.
Add(
" (Replaced and deleted previous.)" );
1191 if ( it != map->
end() ) {
1192 auto keyString= it->first;
1194 if ( map->
Size() == 0 ) {
1199 logables.
Add(
"Deleted map data " );
1202 logables.
Add(
"No map data found to delete " );
1205 logables.
Add(
" with key {!Q} ", key );
1206 logables.
Add(
"in {}.", (scope + pathLevel) );
1217 bool keyWasEmtpy= key.
IsEmpty();
1222 if ( scope > Scope::Path ) {
1223 pathLevel= int( scope - Scope::Path );
1228 impl->
scopeLogData.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1231 if( map !=
nullptr ) {
1232 auto it= map->
Find( key );
1233 if ( it != map->
end() )
1234 returnValue= it->second;
1237 if ( returnValue.
IsType<
void>() )
1238 store( impl,
Box(), pKey, scope + pathLevel );
1242 logables.
Add(
"Data " );
1245 logables.
Add(
" with key {!Q} ", key );
1246 logables.
Add(
"in ", (scope + pathLevel), ( !returnValue.
IsType<
void>() ?
" received."
1247 :
" not found." ) );
1249 logInternal( impl, Verbosity::Info,
"LGD", logables );
1262 buf.SetBuffer( 2048 );
1264 buf._<
NC>( headLine ).NewLine();
1269 Entry( impl, domain, verbosity );
1276 while( int(impl->logableContainers.size()) < cntAcquirements )
1277 impl->logableContainers.emplace_back( impl->monoAllocator().New<BoxesMA>(impl->monoAllocator) );
1278 BoxesMA& logables= *impl->logableContainers[size_t(cntAcquirements - 1)];
1283void LI::Entry(LoxImpl* impl, const NString& domain, Verbosity verbosity ) {
1286 // auto-initialization of debug loggers
1288 if( impl == Log::Get()->impl
1289 && impl->domains->CountLoggers() == 0
1290 && Log::DEBUG_LOGGER == nullptr )
1291 Log::AddDebugLogger( Log::Get() );
1294 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX", "ALox (ALib) was not properly bootstrapped.
" )
1296 ++impl->CntLogCalls;
1298 if ( impl->domains->CountLoggers() == 0 )
1302 evaluateResultDomain( impl, domain ),
1304 *impl->logableContainers[size_t(impl->CountAcquirements() - 1)],
1305 lang::Inclusion::Include );
1308int LI::IsActive(LoxImpl* impl, Verbosity verbosity, const NString& domain, NAString* resultDomain){
1311 // auto-initialization of debug loggers
1313 if( impl == Log::Get()->impl
1314 && impl->domains->CountLoggers() == 0
1315 && Log::DEBUG_LOGGER == nullptr )
1316 Log::AddDebugLogger( Log::Get() );
1319 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX
", "ALox (ALib) was not properly bootstrapped.
" )
1321 Domain* dom= evaluateResultDomain( impl, domain );
1322 if ( resultDomain != nullptr )
1323 resultDomain->_( dom->FullPath );
1325 if ( impl->domains->CountLoggers() == 0 )
1329 for ( int i= 0; i < dom->CountLoggers() ; ++i )
1330 if( dom->IsActive( i, verbosity ) )
1335Verbosity LI::GetVerbosity(LoxImpl* impl, const NString& domain, NAString* resultDomain){
1338 // auto-initialization of debug loggers
1340 if( impl == Log::Get()->impl
1341 && impl->domains->CountLoggers() == 0
1342 && Log::DEBUG_LOGGER == nullptr )
1343 Log::AddDebugLogger( Log::Get() );
1346 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX
", "ALox (ALib) was not properly bootstrapped.
" )
1348 Domain* dom= evaluateResultDomain( impl, domain );
1349 if ( resultDomain != nullptr )
1350 resultDomain->_( dom->FullPath );
1352 if ( impl->domains->CountLoggers() == 0 )
1353 return Verbosity::Off;
1355 std::array verbosities={ Verbosity::Verbose, Verbosity::Info,
1356 Verbosity::Warning, Verbosity::Error, Verbosity::Off };
1358 for ( auto verbosity : verbosities ) {
1359 for ( int i= 0; i < dom->CountLoggers() ; ++i )
1360 if( dom->IsActive( i, verbosity ) )
1363 return Verbosity::Off;
1366void LI::IncreaseLogCounter( LoxImpl* impl) { ++impl->CntLogCalls; }
1368void LI::entryDetectDomainImpl(LoxImpl* impl, Verbosity verbosity ) {
1369 BoxesMA& logables= *impl->logableContainers[size_t(impl->CountAcquirements() - 1)];
1370 if ( logables.Size() > 1 && logables[0].IsArrayOf<nchar>() ) {
1371 NString firstArg= logables[0].Unbox<NString>();
1373 // accept internal domain at the start
1375 if( firstArg.StartsWith( Lox::InternalDomains ) )
1376 idx+= Lox::InternalDomains.Length();
1378 // loop over domain and check for illegal characters
1379 bool illegalCharacterFound= false;
1380 for( ; idx< firstArg.Length() ; ++idx ) {
1381 char c= firstArg[idx];
1382 if (! ( isdigit( c )
1383 || ( c >= 'A' && c <= 'Z' )
1390 illegalCharacterFound= true;
1394 if ( illegalCharacterFound ) {
1395 Entry( impl, nullptr, verbosity );
1399 logables.erase( logables.begin() );
1400 Entry( impl, firstArg, verbosity );
1404 Entry( impl, nullptr, verbosity );
1408//##################################################################################################
1410//##################################################################################################
1411Domain* LI::evaluateResultDomain(LoxImpl* impl, const NString& domainPath ) {
1412 NString128 resDomain;
1414 // 0. internal domain tree?
1415 if ( domainPath.StartsWith( Lox::InternalDomains ) ) {
1416 // cut "$/
" from the path
1417 resDomain._( domainPath, Lox::InternalDomains.Length() );
1418 return findDomain( impl, *impl->internalDomains, resDomain );
1422 NString64 localPath; localPath.DbgDisableBufferReplacementWarning();
1423 impl->scopeDomains.InitWalk( Scope::ThreadInner,
1424 // we have to provide NULL_STRING if parameter is empty
1425 domainPath.IsNotEmpty() ? localPath._(domainPath)
1428 NString nextDefault;
1429 while( (nextDefault= impl->scopeDomains.Walk() ).IsNotNull() ) {
1430 ALIB_ASSERT( nextDefault.IsNotEmpty(), "ALOX" )
1432 if ( resDomain.IsNotEmpty() )
1433 resDomain.InsertAt( "/
", 0);
1434 resDomain.InsertAt( nextDefault, 0 );
1436 // absolute path? That's it
1437 if ( resDomain.CharAtStart() == Domain::Separator() )
1440 return findDomain( impl, *impl->domains, resDomain );
1443void LI::getVerbosityFromConfig(LoxImpl* impl, Variable& v, Logger* logger, Domain& dom ) {
1444 // get logger number. It may happen that the logger is not existent in this domain tree.
1445 int loggerNo= dom.GetLoggerNo( logger ) ;
1449 auto& cvVerb = v.Get<alib::lox::CVVerbosities>();
1451 for (auto it : cvVerb) {
1452 Tokenizer verbosityTknzr( it, '=' );
1454 NString256 domainStrBuf;
1455 Substring domainStrParser= verbosityTknzr.Next();
1456 if ( domainStrParser.ConsumeString<lang::Case::Ignore>( A_CHAR("INTERNAL_DOMAINS
")) ) {
1457 while ( domainStrParser.ConsumeChar('/') )
1459 domainStrBuf << Lox::InternalDomains << domainStrParser;
1462 domainStrBuf._( domainStrParser );
1464 NSubstring domainStr= domainStrBuf ;
1466 Substring verbosityStr= verbosityTknzr.Next();
1467 if ( verbosityStr.IsEmpty() )
1471 if ( domainStr.ConsumeChar ( '*' ) ) searchMode+= 2;
1472 if ( domainStr.ConsumeCharFromEnd( '*' ) ) searchMode+= 1;
1473 if( ( searchMode == 0 && dom.FullPath.Equals <NC ,lang::Case::Ignore>( domainStr ) )
1474 || ( searchMode == 1 && dom.FullPath.StartsWith<CHK,lang::Case::Ignore>( domainStr ) )
1475 || ( searchMode == 2 && dom.FullPath.EndsWith <CHK,lang::Case::Ignore>( domainStr ) )
1476 || ( searchMode == 3 && dom.FullPath.IndexOf <CHK,lang::Case::Ignore>( domainStr ) >=0 )
1479 Verbosity verbosity(Verbosity::Info);
1480 enumrecords::Parse<Verbosity>(verbosityStr, verbosity );
1481 dom.SetVerbosity( loggerNo, verbosity, v.GetPriority() );
1486 ._<
NC>(
'\'' )._<NC>( dom.FullPath )
1488 ._(
"= Verbosity::" )
1499 decl=
ALOX.GetConfig()->StoreDeclaration( decl,
1506 if( !variable.
Try(decl) )
1511 prefixTokOuter.
Set(variable,
';',
true);
1512 while(prefixTokOuter.
HasNext()) {
1523 domainStrBuf.
_( domainStrParser );
1535 prefixTokInner.
Next();
1540 if ( domainStr.
ConsumeChar (
'*' ) ) searchMode+= 2;
1551 NString128 msg; msg.
_<
NC>(
"String \"" )._<NC>( prefixStr )._<
NC>(
"\" added as prefix logable for domain \'" )
1553 ._<
NC>(
"\'. (Retrieved from configuration variable \'" )._<NC>(variable)._(
"\'.)" );
1569 int maxSubstitutions= 10;
1576 dom= rootDomain.
Find( domainPath, 1, &wasCreated );
1584 logables.
Add(
"{!Q} registered.", dom->
FullPath );
1585 logInternal( impl, Verbosity::Info,
"DMN", logables );
1592 Box replacements[2];
1595 replacements[0]=
GetName( impl );
1596 replacements[1]= logger->
GetName();
1607 logInternal( impl, Verbosity::Verbose,
"DMN",
" No loggers set, yet." );
1614 logInternal( impl, Verbosity::Verbose,
"DMN", msg );
1627 while( maxSubstitutions-- > 0 ) {
1629 bool substituted=
false;
1631 switch( rule.type ) {
1634 if ( domFullPath.
StartsWith( rule.Search ) ) {
1635 substPath.
_( rule.Replacement ).
_( domFullPath, rule.Search.
Length() );
1649 if ( domFullPath.
EndsWith( rule.Search ) ) {
1650 substPath.
_( domFullPath, 0, domFullPath.
Length() - rule.Search.Length() ).
_( rule.Replacement );
1655 if ( substPath.
EndsWith( rule.Search ) ) {
1656 substPath.
DeleteEnd( rule.Search.Length() ).
_( rule.Replacement );
1668 substPath.
_( domFullPath, 0, idx ).
_( rule.Replacement).
_( domFullPath, idx + rule.Search.
Length() );
1685 if ( domFullPath.
Equals<
NC>( rule.Search ) ) {
1686 substPath.
_( rule.Replacement);
1691 substPath.
_( rule.Replacement);
1696 if ( substPath.
Equals<
NC>( rule.Search) ) {
1697 substPath.
Reset( rule.Replacement );
1703 default:
ALIB_ERROR(
"ALOX",
"Illegal switch state." )
break;
1714 if ( maxSubstitutions <= 0 && !impl->oneTimeWarningCircularDS ) {
1717 "The Limit of 10 domain substitutions was reached. Circular substitution assumed!"
1718 " (This error is only reported once!)" );
1722 if( substPath.
Length() > 0 ) {
1723 domainPath= substPath;
1732 if ( scope > Scope::Path ) {
1733 pathLevel= int( scope - Scope::Path );
1742 logables.
Add(
"Missing scope information. Cant use {}.", (scope + pathLevel) );
1743 logInternal( impl, Verbosity::Error, internalDomain, logables );
1751 if ( scope == Scope::ThreadOuter
1752 || scope == Scope::ThreadInner )
1756 logables.
Add(
"Illegal parameter, only Scope::ThreadOuter and Scope::ThreadInner allowed."
1757 " Given: {}.", scope );
1758 logInternal( impl, Verbosity::Error,
"DMN", logables );
1764 #if !ALIB_SINGLE_THREADED
1766 #elif ALIB_EXT_LIB_THREADS_AVAILABLE
1771 0,
"Illegal scope type \"{}\" given. Only Scope::ThreadOuter and "
1772 "Scope::ThreadInner allowed.", scope );
1781 bool logablesCollected=
false;
1784 if( dom->
IsActive( i, verbosity ) ) {
1786 if ( !logablesCollected ) {
1787 logablesCollected=
true;
1788 impl->
scopePrefixes.InitWalk( Scope::ThreadInner, &marker );
1790 int userLogablesSize= int( logables.
Size() );
1791 int threadInnersSize= -1;
1794 if( next != &marker ) {
1801 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1802 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1803 (*boxes)[
size_t(pfxI)] );
1807 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1808 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1809 (*boxes)[
size_t(pfxI)] );
1813 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1814 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1815 (*boxes)[
size_t(pfxI)] );
1818 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ), *next );
1823 bool excludeOthers=
false;
1824 threadInnersSize= int( logables.
Size() ) - userLogablesSize;
1826 while ( pflDom !=
nullptr ) {
1832 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1833 logables.emplace( logables.begin(),
1834 (*boxes)[
size_t(pfxI)] );
1838 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1839 logables.emplace( logables.begin(),
1840 (*boxes)[
size_t(pfxI)] );
1844 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1845 logables.emplace( logables.begin(),
1846 (*boxes)[
size_t(pfxI)] );
1849 logables.emplace( logables.begin(), prefix );
1853 excludeOthers=
true;
1857 pflDom= excludeOthers ? nullptr : pflDom->
Parent;
1861 if (excludeOthers) {
1862 for (
int ii= 0; ii < threadInnersSize ; ++ii )
1863 logables.pop_back();
1871 logger->
Log( *dom, verbosity, logables, impl->
scopeInfo );
1894 logables.
Add( msg );
1895 logInternal( impl, verbosity, subDomain, logables );
1906 buf.
InsertChars(
' ', maxDomainPathLength + 5 - idx + reference, idx);
1911 getStateDomainRecursive( subDomain, maxDomainPathLength, buf );
1914void getStateDomainsWithDiffVerb( Domain& dom,
int loggerNo, std::vector<Domain*>& results );
1915void getStateDomainsWithDiffVerb( Domain& dom,
int loggerNo, std::vector<Domain*>& results ) {
1916 if ( dom.Parent ==
nullptr
1917 || dom.Parent->GetVerbosity(loggerNo) != dom.GetVerbosity(loggerNo) )
1918 results.emplace_back( &dom );
1920 for(
auto& it : dom.SubDomains )
1921 getStateDomainsWithDiffVerb( it, loggerNo, results );
1924void getStateCollectPrefixes( Domain& dom,
integer indentSpaces,
NAString& target );
1925void getStateCollectPrefixes( Domain& dom,
integer indentSpaces,
NAString& target ) {
1927 for (
auto& pfl : dom.PrefixLogables ) {
1931 buffer.
_( *
static_cast<Box*
>(pfl.first) );
1936 buffer.
_<
NC>(
" (Excl.)" );
1937 buffer.
_<
NC>(
Tab( 25, -1 ) );
1938 buffer.
_<
NC>(
"<domain> [" )._<NC>( dom.FullPath )._<
NC>(
']').NewLine();
1942 for(
auto& subDom : dom.SubDomains )
1943 getStateCollectPrefixes( subDom, indentSpaces, target );
1960 buf.
_<
NC>(
"ALib Configuration Macros:" ).NewLine();
1983 buf.
_<
NC>(
"#Log Calls: " )._<NC>( impl->
CntLogCalls ).NewLine();
1991 buf.
_<
NC>(
"Source Path Trimming Rules: " ).NewLine();
1995 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo ) {
1997 std::vector<ScopeInfo::SourcePathTrimRule>* trimInfoList=
2003 for (
auto& ti : *trimInfoList ) {
2005 buf.
_<
NC>( trimInfoNo == 0 ?
" Global: "
2007 buf.
_<
NC>( ti.IsPrefix ?
"\"" :
"\"*");
2008 buf.
_<
NC>( ti.Path )._<NC>(
"\", " );
2009 buf.
_<
NC>( ti.IncludeString );
2010 if ( ti.TrimOffset != 0 )
2011 buf.
_<
NC>( ti.Path )._<NC>(
"\", Offset: " )._<
NC>( ti.TrimOffset );
2012 buf.
_<
NC>(
", Priority: " )._( ti.Priority );
2018 buf.
_<
NC>(
" <no rules set>" ).NewLine();
2024 buf.
_<
NC>(
"Domain Substitution Rules: " ).NewLine();
2029 if ( maxWidth < it.Search.Length() )
2030 maxWidth = it.Search.Length();
2040 buf.
_<
NC>( it.Search );
2045 buf.
_<
NC>(
NTab( maxWidth, -1, 0 ) )
2047 ._<
NC>( it.Replacement );
2051 buf.
_<
NC>(
" <no rules set>" ).NewLine();
2057 buf.
_<
NC>(
"Once() Counters: " ).NewLine();
2058 if ( scopeDump.writeStoreMap( &impl->
scopeLogOnce ) == 0 )
2059 buf.
_<
NC>(
" <no Once() counters set>" ).NewLine();
2065 buf.
_<
NC>(
"Log Data: " ).NewLine();
2066 if ( scopeDump.writeStoreMap( &impl->
scopeLogData ) == 0 )
2067 buf.
_<
NC>(
" <no data objects stored>" ).NewLine();
2073 buf.
_<
NC>(
"Prefix Logables: " ).NewLine();
2076 getStateCollectPrefixes( *impl->
domains, 2, buf );
2077 if ( oldLength == buf.
Length() )
2078 buf.
_<
NC>(
" <no prefix logables set>" ).NewLine();
2084 #if !ALIB_SINGLE_THREADED
2085 buf.
_<
NC>(
"Named Threads: " ).NewLine();
2087 buf.
_<
NC>(
" <no thread name mappings set>" ).NewLine();
2091 <<
'\"' << pair.second <<
'\"';
2100 buf.
_<
NC>(
"Scope Domains: " ).NewLine();
2101 if ( scopeDump.writeStore( &impl->
scopeDomains, 2 ) == 0 )
2102 buf.
_<
NC>(
" <no scope domains set>" ).NewLine();
2109 std::vector<Domain*> domainsWithDiffVerb;
2110 for (
int treeNo= 0; treeNo < 2; ++treeNo ) {
2115 buf.
_<
NC>(
"Loggers:" ).NewLine();
2118 buf.
_<
NC>(
"Loggers on Internal Domains:" ).NewLine();
2121 for (
int loggerNo= 0; loggerNo< domTree->
CountLoggers(); ++loggerNo ) {
2127 buf.
_<
NC>(
" " )._<NC>( *logger ).NewLine();
2128 buf.
_<
NC>(
" Lines logged: " )._<NC>( logger->
CntLogs ).NewLine();
2131 buf.
_<
NC>(
" Creation time: " )._<NC>( ct.
Format(
A_CHAR(
"yyyy-MM-dd HH:mm:ss"), as64.
Reset()) ).NewLine();
2134 buf.
_<
NC>(
" Last log time: " )._<NC>( ct.
Format(
A_CHAR(
"yyyy-MM-dd HH:mm:ss"), as64.
Reset()) ).NewLine();
2136 domainsWithDiffVerb.clear();
2137 getStateDomainsWithDiffVerb( *domTree, loggerNo, domainsWithDiffVerb);
2138 for (
Domain* dom : domainsWithDiffVerb ) {
2140 ._( dom == *domainsWithDiffVerb.begin() ?
"Verbosities: "
2146 buf <<
"= " <<
boxing::MakePair(dom->GetVerbosity( loggerNo ), dom->GetPriority(loggerNo) )
2150 buf.
_<
NC>(
" <no loggers attached>" ).NewLine();
2156 buf.
_<
NC>(
"Internal Domains:" ).NewLine();
2163 buf.
_<
NC>(
"Domains:" ).NewLine();
2175#undef UNDEFINED_THREAD
2176#undef ASSERT_ACQUIRED
#define ALIB_LOCK_SHARED_WITH(lock)
#define IF_ALIB_THREADS(...)
#define ALIB_CHARACTERS_WIDE
#define ALIB_WARNING(domain,...)
#define ALIB_ASSERT_WARNING(cond, domain,...)
#define ALIB_ERROR(domain,...)
#define ALIB_LOCK_RECURSIVE_WITH(lock)
#define ALIB_ASSERT_ERROR(cond, domain,...)
#define ALIB_CALLER_PRUNED
#define ALIB_LOCK_WITH(lock)
#define ALIB_REL_DBG(releaseCode,...)
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
decltype(std::declval< typename TFDecl::Signature >()(std::declval< Box & >(), std::declval< TArgs >()...)) Call(TArgs &&... args) const
integer UnboxLength() const
std::pair< Iterator, bool > EmplaceOrAssign(const KeyType &key, TArgs &&... args)
Iterator Find(const KeyType &key)
integer erase(const KeyType &key)
Iterator InsertUnique(const StoredType &value)
integer Size() const noexcept
static void ReplaceToReadable(AString &target, integer startIdx)
static void RemoveDebugLogger(Lox *lox)
static textlogger::TextLogger * DEBUG_LOGGER
The debug logger created by AddDebugLogger.
static constexpr NString InternalDomains
Domain * Find(NSubstring domainPath, int maxCreate, bool *wasCreated)
void ToString(NAString &target)
bool ConfigurationAlreadyRead
Flag which is set when verbosity configuration data was read.
void RemoveLogger(int loggerNo)
Domain * Parent
The parent domain. For root domains, this is nullptr.
bool IsActive(int loggerNo, Verbosity verbosity)
Verbosity GetVerbosity(int loggerNo)
ListMA< Domain, Recycling::None > SubDomains
A list of subdomains, sorted by name.
Verbosity SetVerbosity(int loggerNo, Verbosity verbosity, Priority priority)
NString FullPath
The full path of the domain (set in the constructor once) .
Priority GetPriority(int loggerNo)
ListPA< std::pair< PrefixLogable *, lang::Inclusion >, Recycling::None > PrefixLogables
Prefix Logables associated with this domain.
int GetLoggerNo(const NString &loggerName)
int AddLogger(detail::Logger *logger)
detail::Logger * GetLogger(const NString &loggerName)
const NString & GetName() const
virtual void Log(Domain &dom, Verbosity verbosity, BoxesMA &logables, ScopeInfo &scope)=0
time::Ticks TimeOfLastLog
Timestamp of the last log operation.
virtual void AcknowledgeLox(LoxImpl *lox, lang::ContainerOp op)
time::Ticks TimeOfCreation
The creation time of the Logger.
static std::vector< SourcePathTrimRule > GlobalSPTRs
List of trim definitions for portions of source paths to be ignored.
const NCString GetMethod()
const NCString & GetOrigFile()
std::thread::id GetThreadNativeID()
const NString GetLoxName()
const NString GetFileName()
const NString GetFullPath()
void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
NString loxName
The name of the Lox we are attached to.
void SetFileNameCacheCapacity(integer numberOfLists, integer entriesPerList)
ThreadDictionary threadDictionary
void PopNestedScope()
Releases latest scope information.
void Set(const lang::CallerInfo &ci)
std::vector< SourcePathTrimRule > LocalSPTRs
List of trim definitions for portions of source paths to be ignored.
const std::type_info * GetTypeInfo()
TickConverter DateConverter
static TMonoAllocator * Create(const char *dbgName, lang::HeapAllocator &pAllocator, size_t initialBufferSizeInKB, unsigned bufferGrowthInPercent=200)
void Reset(Snapshot snapshot=Snapshot())
TAString & ReplaceSubstring(const TString< TChar > &src, integer regionStart, integer regionLength)
TAString & DeleteEnd(integer regionLength)
TAString & InsertChars(TChar c, integer qty)
TAString & _(const TAppendable &src)
TAString & Trim(const TCString< TChar > &trimChars=CStringConstantsTraits< TChar >::DefaultWhitespaces())
constexpr integer Length() const
constexpr bool IsEmpty() const
bool EndsWith(const TString &needle) const
TChar CharAtStart() const
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsNotNull() const
constexpr bool IsNotEmpty() const
TString< TChar > Substring(integer regionStart, integer regionLength=MAX_LEN) const
bool Equals(const TString< TChar > &rhs) const
constexpr bool IsNull() const
bool StartsWith(const TString &needle) const
void Free(TAllocator &allocator)
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=CStringConstantsTraits< TChar >::DefaultWhitespaces())
void Set(const DateTime &timeStamp, lang::Timezone timezone=lang::Timezone::Local)
AString & Format(Substring format, AString &target, lang::CurrentData targetData=lang::CurrentData::Keep) const
void Set(const TString< TChar > &src, TChar delimiter, bool skipEmptyTokens=false)
TSubstring< TChar > Actual
TSubstring< TChar > & Next(lang::Whitespaces trimming=lang::Whitespaces::Trim, TChar newDelim='\0')
void AcquireRecursive(ALIB_DBG_TAKE_CI)
void ReleaseRecursive(ALIB_DBG_TAKE_CI)
static Thread * GetCurrent()
virtual const character * GetName() const
static DateTime FromFileTime(const FILETIME &fileTime)
static DateTime FromEpochSeconds(time_t epochSeconds)
DateTime ToDateTime(Ticks ticks)
Ticks ToTicks(DateTime dateTime)
void SetAs(const TDerived &other)
static const Declaration * Get(TEnum element)
bool Define(Priority requestedPriority=Priority::Standard)
bool Try(const String &name)
Variable & Declare(const String &name, const String &typeName, const String &defaultValue=NULL_STRING)
void Raise(const lang::CallerInfo &ci, int type, std::string_view domain, TArgs &&... args)
constexpr Pair< T1, T2 > MakePair(const T1 &t1, const T2 &t2)
bool ParseEnumOrTypeBool(strings::TSubstring< TChar > &input, TEnum &result, TEnum falseValue, TEnum trueValue)
bool Parse(strings::TSubstring< TChar > &input, TEnum &result)
Reach
Denotes the reach of something.
@ Global
Denotes global reach.
@ Left
Chooses left alignment.
@ Remove
Denotes removals.
@ Insert
Denotes insertions.
@ On
Switch it on, switched on, etc.
Case
Denotes upper and lower case character treatment.
@ Trim
Trim whitespaces away.
Inclusion
Denotes how members of a set something should be taken into account.
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
HashMap< PoolAllocator, NString, T, std::hash< NString >, std::equal_to< NString >, lang::Caching::Enabled, Recycling::None > SSMap
Shortcut to the ScopeStore's hashmap.
@ ScopeDomains
Scope domains.
@ CompilationFlags
ALib/ALox compilation flags
@ DSR
Domain substitution rules.
@ InternalDomains
Internal domains.
@ Version
Library Version and thread safeness.
@ PrefixLogables
Prefix logables.
@ Domains
Log domains currently registered.
@ LogData
Log data objects.
@ Basic
Name and number of log calls.
@ SPTR
Source path trim rules.
@ ThreadMappings
Named threads.
@ VERBOSITY
Denotes configuration variable #"alxcvALOX_LOGGERNAME_VERBOSITY_WITH_LOXNAME".
@ DOMAIN_SUBSTITUTION
Denotes configuration variable #"alxcvALOX_LOXNAME_DOMAIN_SUBSTITUTION" used by class #"Lox".
@ DUMP_STATE_ON_EXIT
Denotes configuration variable #"alxcvALOX_LOXNAME_DUMP_STATE_ON_EXIT" used by class #"Lox".
@ PREFIXES
Denotes configuration variable #"alxcvALOX_LOXNAME_PREFIXES" used by class #"Lox".
integer ThreadID
The ALib thread identifier type.
variables::Variable CampVariable(camp::Camp &camp)
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
threads::ThreadID ThreadID
Type to store thread identifiers.
strings::TString< nchar > NString
Type alias in namespace #"%alib".
lox::textlogger::TextLogger TextLogger
Type alias in namespace #"%alib".
strings::TField< nchar > NField
Type alias in namespace #"%alib".
NLocalString< 32 > NString32
Type alias name for #"TLocalString;TLocalString<nchar,32>".
constexpr NString NULL_NSTRING
A nulled string of the narrow character type.
variables::Priority Priority
Type alias in namespace #"%alib".
threads::Thread Thread
Type alias in namespace #"%alib".
strings::TCString< nchar > NCString
Type alias in namespace #"%alib".
variables::Variable Variable
Type alias in namespace #"%alib".
strings::TTab< nchar > NTab
Type alias in namespace #"%alib".
CompilationFlagMeaningsEntry COMPILATION_FLAG_MEANINGS[40]
strings::util::TTokenizer< character > Tokenizer
Type alias in namespace #"%alib".
containers::List< T, MonoAllocator, TRecycling > ListMA
Type alias in namespace #"%alib".
strings::TEscape< character > Escape
Type alias in namespace #"%alib".
LocalString< 64 > String64
Type alias name for #"TLocalString;TLocalString<character,64>".
constexpr CString NEW_LINE
A zero-terminated string containing the new-line character sequence.
lox::ALoxCamp ALOX
The singleton instance of ALib Camp class #"ALoxCamp".
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace #"%alib".
boxing::TBoxes< lang::HeapAllocator > Boxes
Type alias in namespace #"%alib".
lang::integer integer
Type alias in namespace #"%alib".
monomem::TPoolAllocator< MonoAllocator > PoolAllocator
boxing::Box Box
Type alias in namespace #"%alib".
TCompilationFlags COMPILATION_FLAGS
boxing::TBoxes< PoolAllocator > BoxesPA
Type alias in namespace #"%alib".
strings::TString< character > String
Type alias in namespace #"%alib".
strings::TSubstring< character > Substring
Type alias in namespace #"%alib".
strings::TSubstring< nchar > NSubstring
Type alias in namespace #"%alib".
strings::util::CalendarDateTime CalendarDateTime
Type alias in namespace #"%alib".
LocalString< 128 > String128
Type alias name for #"TLocalString;TLocalString<character,128>".
boxing::TBoxes< MonoAllocator > BoxesMA
Type alias in namespace #"%alib".
NLocalString< 256 > NString256
Type alias name for #"TLocalString;TLocalString<nchar,256>".
LocalString< 256 > String256
Type alias name for #"TLocalString;TLocalString<character,256>".
time::Ticks Ticks
Type alias in namespace #"%alib".
boxing::FEquals FEquals
Type alias in namespace #"%alib".
NLocalString< 128 > NString128
Type alias name for #"TLocalString;TLocalString<nchar,128>".
NLocalString< 512 > NString512
Type alias name for #"TLocalString;TLocalString<nchar,512>".
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace #"%alib".
variables::Declaration Declaration
Type alias in namespace #"%alib".
time::TickConverter TickConverter
Type alias in namespace #"%alib".
std::vector< T, StdMA< T > > StdVectorMA
Type alias in namespace #"%alib".
NLocalString< 64 > NString64
Type alias name for #"TLocalString;TLocalString<nchar,64>".
LocalString< 32 > String32
Type alias name for #"TLocalString;TLocalString<character,32>".
threads::RecursiveLock RecursiveLock
Type alias in namespace #"%alib".
time::DateTime DateTime
Type alias in namespace #"%alib".
strings::TTab< character > Tab
Type alias in namespace #"%alib".
void Clear()
Frees all allocated strings and clears vector.
integer Add(const strings::TString< character > &src)
Domain substitution rules.
NString32 Search
The path to search.
@ EndsWith
Ends with match.
@ Substring
Any substring.
@ StartsWith
Starts with match.
DomainSubstitutionRule(const NString &s, const NString &r)
NString32 Replacement
The replacement.
static BoxesMA & GetLogableContainer(LoxImpl *impl)
static const NString & GetName(LoxImpl *impl)
static void getVerbosityFromConfig(LoxImpl *impl, variables::Variable &variable, detail::Logger *logger, detail::Domain &dom)
static BoxesMA & acquireInternalLogables(LoxImpl *impl)
static void SetFileNameCacheCapacity(LoxImpl *impl, integer numberOfLists, integer entriesPerList)
static detail::Domain * evaluateResultDomain(LoxImpl *impl, const NString &domainPath)
static void logInternal(LoxImpl *impl, Verbosity verbosity, const NString &subDomain, BoxesMA &msg)
static void SetStartTime(LoxImpl *impl, Ticks startTime, const NString &loggerName)
static integer & GetLogCounter(LoxImpl *impl)
static int checkScopeInformation(LoxImpl *impl, Scope &scope, const NString &internalDomain)
static void init(LoxImpl *impl)
static void Destruct(LoxImpl *lox)
static void store(LoxImpl *impl, const Box &data, const NString &pKey, Scope scope)
static void RemoveThreadDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
static bool RemoveLogger(LoxImpl *impl, detail::Logger *logger)
static void SetVerbosity(LoxImpl *impl, detail::Logger *logger, Verbosity verbosity, const NString &domain, Priority priority)
static void SetDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, threads::Thread *thread)
static detail::Domain * findDomain(LoxImpl *impl, detail::Domain &domainSystem, NString domainPath)
static void SetDomainSubstitutionRule(LoxImpl *impl, const NString &domainPath, const NString &replacement)
static void SetPrefix(LoxImpl *impl, const Box &prefix, const NString &domain, lang::Inclusion otherPLs)
static void Release(LoxImpl *impl)
static void writeVerbositiesOnLoggerRemoval(LoxImpl *impl, Logger *logger)
static void setPrefix(LoxImpl *impl, const Box &prefix, Scope scope, threads::Thread *thread)
static void SetVerbosityExport(LoxImpl *impl, detail::Logger *logger, bool value, Priority priority=Priority::Standard)
static void log(LoxImpl *impl, detail::Domain *dom, Verbosity verbosity, BoxesMA &logables, lang::Inclusion prefixes)
static void getAllVerbosities(LoxImpl *impl, variables::Variable &variable, detail::Logger *logger, detail::Domain &dom)
static void once(LoxImpl *impl, const NString &domain, Verbosity verbosity, const Box &logables, const String &pGroup, Scope scope, int quantity)
static void SetSourcePathTrimRule(LoxImpl *impl, const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
static void Entry(LoxImpl *impl, const NString &domain, Verbosity verbosity)
static void getDomainPrefixFromConfig(LoxImpl *impl, detail::Domain &dom)
static LoxImpl * Construct(const NString &name)
static void Acquire(LoxImpl *impl, const lang::CallerInfo &ci)
static void GetState(LoxImpl *impl, NAString &buf, StateInfo flags)
static MonoAllocator & DbgGetMonoAllocator(LoxImpl *impl)
static Box retrieve(LoxImpl *impl, const NString &pKey, Scope scope)
static void setDomain(LoxImpl *impl, const NString &scopeDomain, Scope scope, bool removeNTRSD, threads::Thread *thread)
static void dumpStateOnLoggerRemoval(LoxImpl *impl)
static detail::Logger * GetLogger(LoxImpl *impl, const NString &loggerName)
static threads::RecursiveLock & getLock(LoxImpl *impl)
static bool isThreadRelatedScope(LoxImpl *impl, Scope scope)
static void State(LoxImpl *impl, const NString &domain, Verbosity verbosity, const String &headLine, StateInfo flags)
static void MapThreadName(LoxImpl *impl, const String &threadName, threads::ThreadID id)
monomem::Snapshot beforeLox
Snapshot taken before embedding the lox in the #"monoAllocator".
ScopeStore< SSMap< int > *, false > scopeLogOnce
Log once counters.
Domain * internalDomains
The root domain for internal Log Domains.
T * newPO(TArgs &&... args)
ScopeInfo scopeInfo
Information about the source code, method, thread, etc. invoking a log call.
ScopeStore< NString, true > scopeDomains
Scope Domains.
PoolAllocator poolAllocator
A pool allocator that uses #"monoAllocator" as its source.
integer maxLoggerNameLength
Used for tabular output of logger lists.
int CountAcquirements() const noexcept
const NString noKeyHashKey
A key value used in stores if no key is given (global object).
bool oneTimeWarningCircularDS
Flag if a warning on circular rule detection was logged.
StdVectorMA< BoxesMA * > internalLogables
A list of a list of logables used for (recursive) internal logging.
integer maxDomainPathLength
Used for tabular output of logger lists.
StdVectorMA< BoxesMA * > logableContainers
A list of a list of logables used for (recursive) logging.
ListMA< DomainSubstitutionRule > domainSubstitutions
The list of domain substitution rules.
MonoAllocator & monoAllocator
The self-contained monotonic allocator, that also contains this struct itself.
bool loggerAddedSinceLastDebugState
Flag used with configuration variable LOXNAME_DUMP_STATE_ON_EXIT.
int AcquirementsCount
Counts the number of nested (recursive) acquirements.
LoxImpl(MonoAllocator *ma, const NString &name)
ScopeStore< SSMap< Box > *, false > scopeLogData
Log data store.
ScopeStore< PrefixLogable *, true > scopePrefixes
Prefix logables store.
integer internalLogRecursionCounter
The recursion counter for internal logging.
threads::RecursiveLock Lock
A mutex to control parallel access.