9#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
10# error "Configuration MACRO ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
22 module ALib.ALox.Impl;
27 import ALib.Strings.Tokenizer;
29 import ALib.EnumRecords;
30 import ALib.EnumRecords.Bootstrap;
31 import ALib.Variables;
33 import ALib.Camp.Base;
34 import ALib.Bootstrap;
50#if !ALIB_SINGLE_THREADED
51# define UNDEFINED_THREAD threads::UNDEFINED
53# define UNDEFINED_THREAD 0
86 Search .DbgDisableBufferReplacementWarning();
109 Search._( s, startPos, length );
114 &&
Search.CharAtStart() !=
'/'
117 &&
Search.CharAtEnd() ==
'/'
142 #if !ALIB_SINGLE_THREADED
229 for (
int i=
domains->CountLoggers() - 1 ; i >= 0 ; --i ) {
256 template<
typename T,
typename... TArgs>
268#define ASSERT_ACQUIRED ALIB_ASSERT_ERROR( impl->CountAcquirements() >0,"ALOX","Lox not acquired" )
279 LoxImpl* result= (*selfContainedMA)().New<LoxImpl>( selfContainedMA, name );
294#if !ALIB_SINGLE_THREADED
303 #if !ALIB_SINGLE_THREADED
316 #if !ALIB_SINGLE_THREADED
329 const NString internalDomainList[]= {
"LGR",
"DMN",
"PFX",
"THR",
"LGD",
"VAR" };
330 for (
auto& it : internalDomainList )
347 for(
int ruleNo= 0 ; ruleNo < var.
Size() ; ++ruleNo ) {
359 ALIB_WARNING(
"ALOX",
"Syntax error in variable \"{}\".", var )
381 (*loxMA)().Delete(impl);
382 loxMA->
Reset(snapshot);
384 (*loxMA)().New<LoxImpl>(loxMA, name );
386 ALIB_ASSERT_ERROR( impl == dbgNewAddress,
"ALOX",
"Internal error. This must never happen." )
402 const NString& trimReplacement,
407 trimReplacement, reach, priority );
414 setDomain( impl, scopeDomain, scope,
false, thread );
425 if ( (logger= impl->
domains ->
GetLogger( loggerName ) ) !=
nullptr )
return logger;
430 logables.
Add(
"No logger named {!Q} found.", loggerName );
431 logInternal( impl, Verbosity::Warning,
"LGR", logables );
440 if( parentVerbosity != verbosity || verbosities.
ExportAll )
445 writeVerbVarRecursive( subDomain, loggerNo, verbosities, verbosity );
451DOX_MARKER([DOX_VARIABLES_REPLACEMENTS2])
464DOX_MARKER( [DOX_VARIABLES_REPLACEMENTS2])
475 if ( loggerNoMainDom >= 0 ) writeVerbVarRecursive( *impl->
domains , loggerNoMainDom, cvVerb,
Verbosity(-1) );
487 logables.
Add(
"Verbosities for logger {!Q} written to variable {!Q}",
489 logInternal( impl, Verbosity::Info,
"VAR", logables );
495 logables.
Add(
" Value:");
496 for(
auto& it : cvVerb )
497 logables.
Add(
"\n ", it );
498 logInternal( impl, Verbosity::Verbose,
"VAR", logables );
521 tknzr.
Set(variable,
',',
true);
556 logables.
Add(
"Unknown argument {!Q} in variable {} = {!Q}.",
558 logInternal( impl, Verbosity::Error,
"VAR", logables);
562 State( impl, domain, verbosity,
A_CHAR(
"Auto dump state on exit requested: "), flags );
572 if( noMainDom >= 0 || noIntDom >= 0 ) {
589 logables.
Add(
"Logger {!Q} not found. Nothing removed.", logger );
590 logInternal( impl, Verbosity::Warning,
"LGR", logables );
600 if( noMainDom >= 0 || noIntDom >= 0 ) {
616 logables.
Add(
"Logger {!Q} removed.", logger );
617 logInternal( impl, Verbosity::Info,
"LGR", logables );
623 logables.
Add(
"Logger {!Q} not found. Nothing removed.", loggerName );
624 logInternal( impl, Verbosity::Warning,
"LGR", logables );
633 if ( logger ==
nullptr ) {
635 logables.
Add(
"Given Logger is \"null\". Verbosity not set." );
636 logInternal( impl, Verbosity::Error,
"LGR", logables );
645 bool isNewLogger=
false;
653 .Add(
"Unable to add logger {!Q}. Logger with same name exists.", logger ) );
658 " Request was: SetVerbosity({!Q}, {!Q}, Verbosity::{}, {}). ",
659 logger, dom->
FullPath, verbosity, priority ) );
663 .Add(
" Existing Logger: {!Q}.", existingLogger ) );
692 logables.
Add(
"Logger {!Q}.", logger );
694 logables.
Add(
" added for internal log messages.");
696 logables.
Add(
" added.");
697 logInternal( impl, Verbosity::Info,
"LGR", logables );
712 logables.
Add(
"Logger {!Q}: {!Fill}{!Q'}{!Fill}= Verbosity::{}.",
720 if( actVerbosity != verbosity )
721 logables.
Add(
" Lower priority ({} < {}). Remains {}.",
724 logInternal( impl, Verbosity::Info,
"LGR", logables );
736 int no= dom->GetLoggerNo( loggerName );
738 logger= dom->GetLogger( no );
747 logables.
Add(
"Logger not found. Request was: SetVerbosity({!Q}, {!Q}, Verbosity::{}, {}).",
748 loggerName, dom->FullPath, verbosity, priority );
749 logInternal( impl, Verbosity::Warning,
"LGR", logables );
756 SetVerbosity( impl, logger, verbosity, domain, priority );
772 #if !ALIB_SINGLE_THREADED
773 ThreadID threadID= thread !=
nullptr ? thread->
GetID() : UNDEFINED_THREAD;
781 impl->
scopeDomains.InitAccess( scope, pathLevel, threadID );
783 previousScopeDomain= impl->
scopeDomains.Remove( scopeDomain );
790 previousScopeDomain= impl->
scopeDomains.Remove(
nullptr );
795 if ( !removeNTRSD && scopeDomain.
IsNotEmpty() ) {
796 logables.
Add(
"{!Q'} set as default for {}.", scopeDomain, (scope + pathLevel) );
798 if ( previousScopeDomain.
IsNull() )
799 logInternal( impl, Verbosity::Info,
"DMN", logables );
801 if ( previousScopeDomain.
Equals<
NC>( scopeDomain ) ) {
802 logables.
Add(
"(Wasalreadyset.)");
803 logInternal( impl,Verbosity::Verbose,
"DMN",logables);
805 logables.
Add(
" Replacing previous default {!Q'}.", previousScopeDomain );
806 logInternal( impl, Verbosity::Warning,
"DMN", logables );
811 logables.
Add(
"{!Q'} removed from {}.", previousScopeDomain, (scope + pathLevel) );
812 logInternal( impl, Verbosity::Info,
"DMN", logables );
815 logables.
Add(
"{!Q'} not found. Nothing removed for {}.", scopeDomain );
817 logables.
Add(
"Empty Scope Domain given, nothing registered for {}.", scopeDomain);
819 logables.
Add( scope + pathLevel);
820 logInternal( impl, Verbosity::Warning,
"DMN", logables );
836 logables.
Add(
"Illegal parameter. No scope domain path given. Nothing removed for {}.",
838 logInternal( impl, Verbosity::Warning,
"DMN", logables );
845 setDomain( impl, scopeDomain, scope,
true, thread);
854 logInternal( impl, Verbosity::Info,
"DMN",
"Domain substitution rules removed.");
862 logInternal( impl, Verbosity::Warning,
"DMN",
"Illegal domain substitution rule. Nothing stored." );
869 if ( (*it).type == newRule.
type
870 && (*it).Search.Equals<
NC>( newRule.
Search ) )
878 logables.
Add(
"Domain substitution rule {!Q} not found. Nothing to remove.", domainPath );
879 logInternal( impl, Verbosity::Warning,
"DMN", logables );
883 logables.
Add(
"Domain substitution rule {!Q} -> {!Q} removed.", domainPath, (*it).Replacement );
884 logInternal( impl, Verbosity::Info,
"DMN", logables );
890 logables.
Add(
"Domain substitution rule {!Q} -> {!Q} set.", domainPath, newRule.
Replacement );
895 msg <<
" Replacing previous -> \"" << (*it).Replacement <<
"\".";
902 if(
ALOX.IsBootstrapped() )
903 logInternal( impl, Verbosity::Info,
"DMN", logables );
914 #if !ALIB_SINGLE_THREADED
915 ThreadID threadID= thread !=
nullptr ? thread->
GetID() : UNDEFINED_THREAD;
921 impl->
scopePrefixes.InitAccess( scope, pathLevel, threadID );
922 bool isVoidOrEmpty= prefix.
IsType<
void>()
931 logables.
Add(
"Object ");
932 Verbosity intMsgVerbosity= Verbosity::Info;
933 if ( !isVoidOrEmpty ) {
934 logables.
Add( prefix,
" added as prefix logable for {}.", (scope + pathLevel) );
936 if ( previousLogable !=
nullptr ) {
938 logables.
Add(
" (Same as before.)");
939 intMsgVerbosity= Verbosity::Verbose;
942 logables.
Add(
" Replacing previous {}.", *previousLogable );
945 if ( previousLogable !=
nullptr )
946 logables.
Add(
"{!Q} removed from list of prefix logables for {}.", *previousLogable);
948 logables.
Add(
"<nullptr> given but no prefix logable to remove for {}.");
949 intMsgVerbosity= Verbosity::Warning;
951 logables.
Add( scope + pathLevel );
954 logInternal( impl, intMsgVerbosity,
"PFX", logables );
957 if ( previousLogable !=
nullptr )
969 bool isVoidOrEmpty= prefix.
IsType<
void>()
974 Verbosity intLogVerbosity= Verbosity::Info;
977 if ( !isVoidOrEmpty ) {
979 logables.
Add(
"Object {} added as prefix logable for ", prefix );
983 auto cntPLs= dom->PrefixLogables.size();
985 removedLogable= dom->PrefixLogables.back().first;
986 dom->PrefixLogables.pop_back();
987 logables.
Add(
"Object {} removed from list of prefix logables for",
988 *
static_cast<Box*
>(removedLogable) );
990 logables.
Add(
"No prefix logables to remove for" );
991 intLogVerbosity= Verbosity::Warning;
994 logables.
Add(
" domain {!Q'}.", dom->FullPath);
995 logInternal( impl, intLogVerbosity,
"PFX", logables );
1002#if defined (__GLIBCXX__) || defined(_LIBCPP_VERSION) || defined(__APPLE__) || defined(__ANDROID_NDK__)
1009#elif defined( _WIN32 )
1016 #pragma message "Unknown Platform in file: " __FILE__ )
1022 bool foundOne=
false;
1032 logables.
Add(
"Logger {!Q}: Start time set to ", logger->
GetName() );
1033 if ( !startTime.
IsSet() ) {
1035 logables.
Add(
"'now'" );
1039 if( asTextLogger !=
nullptr )
1043 logables.
Add(
"{:yyyy-MM-dd HH:mm:ss}", asDateTime );
1049 logInternal( impl, Verbosity::Info,
"LGR", logables );
1052 if ( loggerName.
IsNotEmpty() && !foundOne ) {
1054 logables.
Add(
"Logger {!Q}: not found. Start time not set.", loggerName );
1055 logInternal( impl, Verbosity::Error,
"LGR", logables );
1061 #if !ALIB_SINGLE_THREADED
1073 origThreadName=
nullptr;
1080 logables.
Add(
"Mapped thread ID {} to {!Q}.",
id, threadName);
1081 if ( origThreadName.IsNotEmpty() )
1082 logables.
Add(
" Original thread name: {!Q}.", origThreadName );
1083 logInternal( impl, Verbosity::Info,
"THR", logables );
1103 bool groupWasEmtpy= group.
IsEmpty();
1104 if ( groupWasEmtpy ) {
1106 if ( scope == Scope::Global ) {
1107 scope= Scope::Filename;
1117 impl->
scopeLogOnce.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1120 if( map ==
nullptr ) {
1126 auto it= map->
Find( group );
1127 if (it == map->
end() )
1131 if ( quantity >= 0 ) {
1132 if ( it->second < quantity ) {
1137 Entry( impl, domain, verbosity );
1140 if( it->second == quantity ) {
1142 logables.
Add(
"Once() reached limit of {} logs. No further logs for ", quantity );
1144 if ( groupWasEmtpy )
1145 logables.
Add( scope == Scope::Global ?
Box(
"this line" )
1146 :
Box(scope + pathLevel) );
1148 logables.
Add(
"group {!Q}", group );
1149 if ( scope != Scope::Global )
1150 logables.
Add(
" in ", (scope + pathLevel) );
1154 logInternal( impl, Verbosity::Info,
"", logables );
1159 if ( it->second++ % -quantity == 0 ) {
1161 Entry( impl, domain, verbosity );
1168 bool keyWasEmtpy= key.
IsEmpty();
1174 if ( scope > Scope::Path ) {
1175 pathLevel= int( scope - Scope::Path );
1180 impl->
scopeLogData.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1182 if( map ==
nullptr ) {
1190 auto it= map->
Find( key );
1191 if ( !data.
IsType<
void>() ) {
1192 bool replacedPrevious=
false;
1193 if ( it == map->
end() )
1196 replacedPrevious=
true;
1201 logables.
Add(
"Stored data " );
1204 logables.
Add(
" with key {!Q} ", key );
1205 logables.
Add(
"in {}.", (scope + pathLevel) );
1206 if ( replacedPrevious )
1207 logables.
Add(
" (Replaced and deleted previous.)" );
1212 if ( it != map->
end() ) {
1213 auto keyString= it->first;
1215 if ( map->
Size() == 0 ) {
1220 logables.
Add(
"Deleted map data " );
1223 logables.
Add(
"No map data found to delete " );
1226 logables.
Add(
" with key {!Q} ", key );
1227 logables.
Add(
"in {}.", (scope + pathLevel) );
1238 bool keyWasEmtpy= key.
IsEmpty();
1243 if ( scope > Scope::Path ) {
1244 pathLevel= int( scope - Scope::Path );
1249 impl->
scopeLogData.InitAccess( scope, pathLevel, UNDEFINED_THREAD );
1252 if( map !=
nullptr ) {
1253 auto it= map->
Find( key );
1254 if ( it != map->
end() )
1255 returnValue= it->second;
1258 if ( returnValue.
IsType<
void>() )
1259 store( impl,
Box(), pKey, scope + pathLevel );
1263 logables.
Add(
"Data " );
1266 logables.
Add(
" with key {!Q} ", key );
1267 logables.
Add(
"in ", (scope + pathLevel), ( !returnValue.
IsType<
void>() ?
" received."
1268 :
" not found." ) );
1270 logInternal( impl, Verbosity::Info,
"LGD", logables );
1283 buf.SetBuffer( 2048 );
1285 buf._<
NC>( headLine ).NewLine();
1290 Entry( impl, domain, verbosity );
1297 while( int(impl->logableContainers.size()) < cntAcquirements )
1298 impl->logableContainers.emplace_back( impl->monoAllocator().New<BoxesMA>(impl->monoAllocator) );
1299 BoxesMA& logables= *impl->logableContainers[size_t(cntAcquirements - 1)];
1304void LI::Entry(LoxImpl* impl, const NString& domain, Verbosity verbosity ) {
1307 // auto-initialization of debug loggers
1309 if( impl == Log::Get()->impl
1310 && impl->domains->CountLoggers() == 0
1311 && Log::DEBUG_LOGGER == nullptr )
1312 Log::AddDebugLogger( Log::Get() );
1315 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX", "ALox (ALib) was not properly bootstrapped.
" )
1317 ++impl->CntLogCalls;
1319 if ( impl->domains->CountLoggers() == 0 )
1323 evaluateResultDomain( impl, domain ),
1325 *impl->logableContainers[size_t(impl->CountAcquirements() - 1)],
1326 lang::Inclusion::Include );
1329int LI::IsActive(LoxImpl* impl, Verbosity verbosity, const NString& domain, NAString* resultDomain){
1332 // auto-initialization of debug loggers
1334 if( impl == Log::Get()->impl
1335 && impl->domains->CountLoggers() == 0
1336 && Log::DEBUG_LOGGER == nullptr )
1337 Log::AddDebugLogger( Log::Get() );
1340 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX
", "ALox (ALib) was not properly bootstrapped.
" )
1342 Domain* dom= evaluateResultDomain( impl, domain );
1343 if ( resultDomain != nullptr )
1344 resultDomain->_( dom->FullPath );
1346 if ( impl->domains->CountLoggers() == 0 )
1350 for ( int i= 0; i < dom->CountLoggers() ; ++i )
1351 if( dom->IsActive( i, verbosity ) )
1356Verbosity LI::GetVerbosity(LoxImpl* impl, const NString& domain, NAString* resultDomain){
1359 // auto-initialization of debug loggers
1361 if( impl == Log::Get()->impl
1362 && impl->domains->CountLoggers() == 0
1363 && Log::DEBUG_LOGGER == nullptr )
1364 Log::AddDebugLogger( Log::Get() );
1367 ALIB_ASSERT_ERROR(ALOX.IsBootstrapped(), "ALOX
", "ALox (ALib) was not properly bootstrapped.
" )
1369 Domain* dom= evaluateResultDomain( impl, domain );
1370 if ( resultDomain != nullptr )
1371 resultDomain->_( dom->FullPath );
1373 if ( impl->domains->CountLoggers() == 0 )
1374 return Verbosity::Off;
1376 std::array verbosities={ Verbosity::Verbose, Verbosity::Info,
1377 Verbosity::Warning, Verbosity::Error, Verbosity::Off };
1379 for ( auto verbosity : verbosities ) {
1380 for ( int i= 0; i < dom->CountLoggers() ; ++i )
1381 if( dom->IsActive( i, verbosity ) )
1384 return Verbosity::Off;
1387void LI::IncreaseLogCounter( LoxImpl* impl) { ++impl->CntLogCalls; }
1389void LI::entryDetectDomainImpl(LoxImpl* impl, Verbosity verbosity ) {
1390 BoxesMA& logables= *impl->logableContainers[size_t(impl->CountAcquirements() - 1)];
1391 if ( logables.Size() > 1 && logables[0].IsArrayOf<nchar>() ) {
1392 NString firstArg= logables[0].Unbox<NString>();
1394 // accept internal domain at the start
1396 if( firstArg.StartsWith( Lox::InternalDomains ) )
1397 idx+= Lox::InternalDomains.Length();
1399 // loop over domain and check for illegal characters
1400 bool illegalCharacterFound= false;
1401 for( ; idx< firstArg.Length() ; ++idx ) {
1402 char c= firstArg[idx];
1403 if (! ( isdigit( c )
1404 || ( c >= 'A' && c <= 'Z' )
1411 illegalCharacterFound= true;
1415 if ( illegalCharacterFound ) {
1416 Entry( impl, nullptr, verbosity );
1420 logables.erase( logables.begin() );
1421 Entry( impl, firstArg, verbosity );
1425 Entry( impl, nullptr, verbosity );
1429//##################################################################################################
1431//##################################################################################################
1432Domain* LI::evaluateResultDomain(LoxImpl* impl, const NString& domainPath ) {
1433 NString128 resDomain;
1435 // 0. internal domain tree?
1436 if ( domainPath.StartsWith( Lox::InternalDomains ) ) {
1437 // cut "$/
" from the path
1438 resDomain._( domainPath, Lox::InternalDomains.Length() );
1439 return findDomain( impl, *impl->internalDomains, resDomain );
1443 NString64 localPath; localPath.DbgDisableBufferReplacementWarning();
1444 impl->scopeDomains.InitWalk( Scope::ThreadInner,
1445 // we have to provide NULL_STRING if parameter is empty
1446 domainPath.IsNotEmpty() ? localPath._(domainPath)
1449 NString nextDefault;
1450 while( (nextDefault= impl->scopeDomains.Walk() ).IsNotNull() ) {
1451 ALIB_ASSERT( nextDefault.IsNotEmpty(), "ALOX" )
1453 if ( resDomain.IsNotEmpty() )
1454 resDomain.InsertAt( "/
", 0);
1455 resDomain.InsertAt( nextDefault, 0 );
1457 // absolute path? That's it
1458 if ( resDomain.CharAtStart() == Domain::Separator() )
1461 return findDomain( impl, *impl->domains, resDomain );
1464void LI::getVerbosityFromConfig(LoxImpl* impl, Variable& v, Logger* logger, Domain& dom ) {
1465 // get logger number. It may happen that the logger is not existent in this domain tree.
1466 int loggerNo= dom.GetLoggerNo( logger ) ;
1470 auto& cvVerb = v.Get<alib::lox::CVVerbosities>();
1472 for (auto it : cvVerb) {
1473 Tokenizer verbosityTknzr( it, '=' );
1475 NString256 domainStrBuf;
1476 Substring domainStrParser= verbosityTknzr.Next();
1477 if ( domainStrParser.ConsumeString<lang::Case::Ignore>( A_CHAR("INTERNAL_DOMAINS
")) ) {
1478 while ( domainStrParser.ConsumeChar('/') )
1480 domainStrBuf << Lox::InternalDomains << domainStrParser;
1483 domainStrBuf._( domainStrParser );
1485 NSubstring domainStr= domainStrBuf ;
1487 Substring verbosityStr= verbosityTknzr.Next();
1488 if ( verbosityStr.IsEmpty() )
1492 if ( domainStr.ConsumeChar ( '*' ) ) searchMode+= 2;
1493 if ( domainStr.ConsumeCharFromEnd( '*' ) ) searchMode+= 1;
1494 if( ( searchMode == 0 && dom.FullPath.Equals <NC ,lang::Case::Ignore>( domainStr ) )
1495 || ( searchMode == 1 && dom.FullPath.StartsWith<CHK,lang::Case::Ignore>( domainStr ) )
1496 || ( searchMode == 2 && dom.FullPath.EndsWith <CHK,lang::Case::Ignore>( domainStr ) )
1497 || ( searchMode == 3 && dom.FullPath.IndexOf <CHK,lang::Case::Ignore>( domainStr ) >=0 )
1500 Verbosity verbosity(Verbosity::Info);
1501 enumrecords::Parse<Verbosity>(verbosityStr, verbosity );
1502 dom.SetVerbosity( loggerNo, verbosity, v.GetPriority() );
1507 ._<
NC>(
'\'' )._<NC>( dom.FullPath )
1509 ._(
"= Verbosity::" )
1520 decl=
ALOX.GetConfig()->StoreDeclaration( decl,
1527 if( !variable.
Try(decl) )
1532 prefixTokOuter.
Set(variable,
';',
true);
1533 while(prefixTokOuter.
HasNext()) {
1544 domainStrBuf.
_( domainStrParser );
1556 prefixTokInner.
Next();
1561 if ( domainStr.
ConsumeChar (
'*' ) ) searchMode+= 2;
1572 NString128 msg; msg.
_<
NC>(
"String \"" )._<NC>( prefixStr )._<
NC>(
"\" added as prefix logable for domain \'" )
1574 ._<
NC>(
"\'. (Retrieved from configuration variable \'" )._<NC>(variable)._(
"\'.)" );
1590 int maxSubstitutions= 10;
1597 dom= rootDomain.
Find( domainPath, 1, &wasCreated );
1605 logables.
Add(
"{!Q} registered.", dom->
FullPath );
1606 logInternal( impl, Verbosity::Info,
"DMN", logables );
1613 Box replacements[2];
1616 replacements[0]=
GetName( impl );
1617 replacements[1]= logger->
GetName();
1628 logInternal( impl, Verbosity::Verbose,
"DMN",
" No loggers set, yet." );
1635 logInternal( impl, Verbosity::Verbose,
"DMN", msg );
1648 while( maxSubstitutions-- > 0 ) {
1650 bool substituted=
false;
1652 switch( rule.type ) {
1655 if ( domFullPath.
StartsWith( rule.Search ) ) {
1656 substPath.
_( rule.Replacement ).
_( domFullPath, rule.Search.
Length() );
1670 if ( domFullPath.
EndsWith( rule.Search ) ) {
1671 substPath.
_( domFullPath, 0, domFullPath.
Length() - rule.Search.Length() ).
_( rule.Replacement );
1676 if ( substPath.
EndsWith( rule.Search ) ) {
1677 substPath.
DeleteEnd( rule.Search.Length() ).
_( rule.Replacement );
1689 substPath.
_( domFullPath, 0, idx ).
_( rule.Replacement).
_( domFullPath, idx + rule.Search.
Length() );
1706 if ( domFullPath.
Equals<
NC>( rule.Search ) ) {
1707 substPath.
_( rule.Replacement);
1712 substPath.
_( rule.Replacement);
1717 if ( substPath.
Equals<
NC>( rule.Search) ) {
1718 substPath.
Reset( rule.Replacement );
1724 default:
ALIB_ERROR(
"ALOX",
"Illegal switch state." )
break;
1735 if ( maxSubstitutions <= 0 && !impl->oneTimeWarningCircularDS ) {
1738 "The Limit of 10 domain substitutions was reached. Circular substitution assumed!"
1739 " (This error is only reported once!)" );
1743 if( substPath.
Length() > 0 ) {
1744 domainPath= substPath;
1753 if ( scope > Scope::Path ) {
1754 pathLevel= int( scope - Scope::Path );
1763 logables.
Add(
"Missing scope information. Cant use {}.", (scope + pathLevel) );
1764 logInternal( impl, Verbosity::Error, internalDomain, logables );
1772 if ( scope == Scope::ThreadOuter
1773 || scope == Scope::ThreadInner )
1777 logables.
Add(
"Illegal parameter, only Scope::ThreadOuter and Scope::ThreadInner allowed."
1778 " Given: {}.", scope );
1779 logInternal( impl, Verbosity::Error,
"DMN", logables );
1785 #if !ALIB_SINGLE_THREADED
1787 #elif ALIB_EXT_LIB_THREADS_AVAILABLE
1792 0,
"Illegal scope type \"{}\" given. Only Scope::ThreadOuter and "
1793 "Scope::ThreadInner allowed.", scope );
1802 bool logablesCollected=
false;
1805 if( dom->
IsActive( i, verbosity ) ) {
1807 if ( !logablesCollected ) {
1808 logablesCollected=
true;
1809 impl->
scopePrefixes.InitWalk( Scope::ThreadInner, &marker );
1811 int userLogablesSize= int( logables.
Size() );
1812 int threadInnersSize= -1;
1815 if( next != &marker ) {
1822 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1823 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1824 (*boxes)[
size_t(pfxI)] );
1828 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1829 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1830 (*boxes)[
size_t(pfxI)] );
1834 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1835 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ),
1836 (*boxes)[
size_t(pfxI)] );
1839 logables.emplace( logables.begin() + ( threadInnersSize < 0 ? userLogablesSize : 0 ), *next );
1844 bool excludeOthers=
false;
1845 threadInnersSize= int( logables.
Size() ) - userLogablesSize;
1847 while ( pflDom !=
nullptr ) {
1853 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1854 logables.emplace( logables.begin(),
1855 (*boxes)[
size_t(pfxI)] );
1859 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1860 logables.emplace( logables.begin(),
1861 (*boxes)[
size_t(pfxI)] );
1865 for (
auto pfxI= boxes->Size() - 1 ; pfxI >= 0 ; --pfxI )
1866 logables.emplace( logables.begin(),
1867 (*boxes)[
size_t(pfxI)] );
1870 logables.emplace( logables.begin(), prefix );
1874 excludeOthers=
true;
1878 pflDom= excludeOthers ? nullptr : pflDom->
Parent;
1882 if (excludeOthers) {
1883 for (
int ii= 0; ii < threadInnersSize ; ++ii )
1884 logables.pop_back();
1892 logger->
Log( *dom, verbosity, logables, impl->
scopeInfo );
1915 logables.
Add( msg );
1916 logInternal( impl, verbosity, subDomain, logables );
1927 buf.
InsertChars(
' ', maxDomainPathLength + 5 - idx + reference, idx);
1932 getStateDomainRecursive( subDomain, maxDomainPathLength, buf );
1935void getStateDomainsWithDiffVerb( Domain& dom,
int loggerNo, std::vector<Domain*>& results );
1936void getStateDomainsWithDiffVerb( Domain& dom,
int loggerNo, std::vector<Domain*>& results ) {
1937 if ( dom.Parent ==
nullptr
1938 || dom.Parent->GetVerbosity(loggerNo) != dom.GetVerbosity(loggerNo) )
1939 results.emplace_back( &dom );
1941 for(
auto& it : dom.SubDomains )
1942 getStateDomainsWithDiffVerb( it, loggerNo, results );
1945void getStateCollectPrefixes( Domain& dom,
integer indentSpaces,
NAString& target );
1946void getStateCollectPrefixes( Domain& dom,
integer indentSpaces,
NAString& target ) {
1948 for (
auto& pfl : dom.PrefixLogables ) {
1952 buffer.
_( *
static_cast<Box*
>(pfl.first) );
1957 buffer.
_<
NC>(
" (Excl.)" );
1958 buffer.
_<
NC>(
Tab( 25, -1 ) );
1959 buffer.
_<
NC>(
"<domain> [" )._<NC>( dom.FullPath )._<
NC>(
']').NewLine();
1963 for(
auto& subDom : dom.SubDomains )
1964 getStateCollectPrefixes( subDom, indentSpaces, target );
1981 buf.
_<
NC>(
"ALib Configuration Macros:" ).NewLine();
2004 buf.
_<
NC>(
"#Log Calls: " )._<NC>( impl->
CntLogCalls ).NewLine();
2012 buf.
_<
NC>(
"Source Path Trimming Rules: " ).NewLine();
2016 for(
int trimInfoNo= 0; trimInfoNo < 2 ; ++trimInfoNo ) {
2018 std::vector<ScopeInfo::SourcePathTrimRule>* trimInfoList=
2024 for (
auto& ti : *trimInfoList ) {
2026 buf.
_<
NC>( trimInfoNo == 0 ?
" Global: "
2028 buf.
_<
NC>( ti.IsPrefix ?
"\"" :
"\"*");
2029 buf.
_<
NC>( ti.Path )._<NC>(
"\", " );
2030 buf.
_<
NC>( ti.IncludeString );
2031 if ( ti.TrimOffset != 0 )
2032 buf.
_<
NC>( ti.Path )._<NC>(
"\", Offset: " )._<
NC>( ti.TrimOffset );
2033 buf.
_<
NC>(
", Priority: " )._( ti.Priority );
2039 buf.
_<
NC>(
" <no rules set>" ).NewLine();
2045 buf.
_<
NC>(
"Domain Substitution Rules: " ).NewLine();
2050 if ( maxWidth < it.Search.Length() )
2051 maxWidth = it.Search.Length();
2061 buf.
_<
NC>( it.Search );
2066 buf.
_<
NC>(
NTab( maxWidth, -1, 0 ) )
2068 ._<
NC>( it.Replacement );
2072 buf.
_<
NC>(
" <no rules set>" ).NewLine();
2078 buf.
_<
NC>(
"Once() Counters: " ).NewLine();
2079 if ( scopeDump.writeStoreMap( &impl->
scopeLogOnce ) == 0 )
2080 buf.
_<
NC>(
" <no Once() counters set>" ).NewLine();
2086 buf.
_<
NC>(
"Log Data: " ).NewLine();
2087 if ( scopeDump.writeStoreMap( &impl->
scopeLogData ) == 0 )
2088 buf.
_<
NC>(
" <no data objects stored>" ).NewLine();
2094 buf.
_<
NC>(
"Prefix Logables: " ).NewLine();
2097 getStateCollectPrefixes( *impl->
domains, 2, buf );
2098 if ( oldLength == buf.
Length() )
2099 buf.
_<
NC>(
" <no prefix logables set>" ).NewLine();
2105 #if !ALIB_SINGLE_THREADED
2106 buf.
_<
NC>(
"Named Threads: " ).NewLine();
2108 buf.
_<
NC>(
" <no thread name mappings set>" ).NewLine();
2112 <<
'\"' << pair.second <<
'\"';
2121 buf.
_<
NC>(
"Scope Domains: " ).NewLine();
2122 if ( scopeDump.writeStore( &impl->
scopeDomains, 2 ) == 0 )
2123 buf.
_<
NC>(
" <no scope domains set>" ).NewLine();
2130 std::vector<Domain*> domainsWithDiffVerb;
2131 for (
int treeNo= 0; treeNo < 2; ++treeNo ) {
2136 buf.
_<
NC>(
"Loggers:" ).NewLine();
2139 buf.
_<
NC>(
"Loggers on Internal Domains:" ).NewLine();
2142 for (
int loggerNo= 0; loggerNo< domTree->
CountLoggers(); ++loggerNo ) {
2148 buf.
_<
NC>(
" " )._<NC>( *logger ).NewLine();
2149 buf.
_<
NC>(
" Lines logged: " )._<NC>( logger->
CntLogs ).NewLine();
2152 buf.
_<
NC>(
" Creation time: " )._<NC>( ct.
Format(
A_CHAR(
"yyyy-MM-dd HH:mm:ss"), as64.
Reset()) ).NewLine();
2155 buf.
_<
NC>(
" Last log time: " )._<NC>( ct.
Format(
A_CHAR(
"yyyy-MM-dd HH:mm:ss"), as64.
Reset()) ).NewLine();
2157 domainsWithDiffVerb.clear();
2158 getStateDomainsWithDiffVerb( *domTree, loggerNo, domainsWithDiffVerb);
2159 for (
Domain* dom : domainsWithDiffVerb ) {
2161 ._( dom == *domainsWithDiffVerb.begin() ?
"Verbosities: "
2167 buf <<
"= " <<
boxing::MakePair(dom->GetVerbosity( loggerNo ), dom->GetPriority(loggerNo) )
2171 buf.
_<
NC>(
" <no loggers attached>" ).NewLine();
2177 buf.
_<
NC>(
"Internal Domains:" ).NewLine();
2184 buf.
_<
NC>(
"Domains:" ).NewLine();
2196#undef UNDEFINED_THREAD
2197#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.
threads::Thread Thread
Type alias in namespace alib.
strings::TCString< nchar > NCString
Type alias in namespace alib.
alib::variables::Priority Priority
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 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.