30#if !ALIB_SINGLE_THREADED
40 friend struct LoxImpl;
76 #if !ALIB_SINGLE_THREADED
225 const NString& trimReplacement,
249 if( srcFile.fullPath.IsNull() )
253 srcFile.fullPath=
NString( srcFile.origFile.Buffer(), idx );
255 srcFile.fullPath=
"";
258 return srcFile.fullPath;
267 if( srcFile.trimmedPath.IsNull() )
270 target.
_( srcFile.trimmedPathPrefix )
271 .
_( srcFile.trimmedPath );
279 if( srcFile.name.IsNull() )
283 srcFile.name=
NString( srcFile.origFile.Buffer() + idx + 1,
284 srcFile.origFile.Length() - idx - 1 );
297 if( srcFile.nameWOExt.IsNull() )
300 integer lastDot= srcFile.nameWOExt.LastIndexOf(
'.' );
302 srcFile.nameWOExt=
NString( srcFile.nameWOExt.Buffer(), lastDot );
304 return srcFile.nameWOExt;
337#if !ALIB_SINGLE_THREADED
396 if( srcFile.origFilePathLength == -2 )
398 return srcFile.origFilePathLength;
static ALIB_DLL std::vector< SourcePathTrimRule > GlobalSPTRs
List of trim definitions for portions of source paths to be ignored.
const NString GetFileNameWithoutExtension()
const NCString GetMethod()
const NCString & GetOrigFile()
const alib::String & GetThreadNameAndID(threads::ThreadID *id)
std::thread::id GetThreadNativeID()
const NString GetLoxName()
void GetTrimmedPath(AString &target)
threads::ThreadID GetThreadID()
const NString GetFileName()
static ALIB_DLL bool GlobalSPTRsReadFromConfig
Flag to determine if global rules have been read from config already.
ALIB_DLL ScopeInfo(const NString &name, MonoAllocator &allocator)
HashMap< MonoAllocator, threads::ThreadID, String32 > ThreadDictionary
A map we use to translate thread IDs to thread names.
const NString GetFullPath()
ALIB_DLL 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.
bool AutoDetectTrimableSourcePath
void SetFileNameCacheCapacity(integer numberOfLists, integer entriesPerList)
StdVectorMono< FrameRecord > callStack
A stack of scopes (allows recursive calls/nested logging).
ThreadDictionary threadDictionary
void PopNestedScope()
Releases latest scope information.
String threadName
The name of the thread that executed the log.
LRUCacheTable< MonoAllocator, ValueDescriptorPFN, std::hash< NString > > parsedFileNameCache
Least recently used cache of parsed file name.
Thread * thread
The thread passed with Set.
int callStackSize
The current depth of recursive invocations.
ALIB_DLL void Set(const lang::CallerInfo &ci)
std::vector< SourcePathTrimRule > LocalSPTRs
List of trim definitions for portions of source paths to be ignored.
std::thread::id threadNativeIDx
The C++ native ID.
const std::type_info * GetTypeInfo()
TAString & _(const TAppendable &src)
static ALIB_DLL Thread * Get(std::thread::id nativeID)
#define ALIB_ASSERT(cond, domain)
Reach
Denotes the reach of something.
Case
Denotes upper and lower case character treatment.
Inclusion
Denotes how members of a set something should be taken into account.
constexpr PathCharType DIRECTORY_SEPARATOR
The standard path separator character. Defaults to '\' on Windows OS, '/' else.
integer ThreadID
The ALib thread identifier type.
containers::LRUCacheTable< TAllocator, TValueDescriptor, THash, TEqual > LRUCacheTable
Type alias in namespace alib.
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace alib.
std::vector< T, SCAMono< T > > StdVectorMono
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
strings::TString< nchar > NString
Type alias in namespace alib.
strings::TAString< nchar, lang::HeapAllocator > NAString
Type alias in namespace alib.
containers::HashMap< TAllocator, TKey, TMapped, THash, TEqual, THashCaching, TRecycling > HashMap
Type alias in namespace alib.
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
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.
strings::TString< character > String
Type alias in namespace alib.
time::Ticks Ticks
Type alias in namespace alib.
static ALIB_DLL void MapThreadName(LoxImpl *impl, const String &threadName, threads::ThreadID id)
static ALIB_DLL void GetState(LoxImpl *impl, NAString &buf, StateInfo flags)
Ticks timeStamp
Time of the call that created this record.
const std::type_info * typeInfo
Type information. Nullptr if call from static or global function.
NCString origMethod
Function/method name (given by the C++ preprocessor)
ParsedFileName * Parsed
The entry from the parsedFileNameCache.
int origLine
Line number within the source file (given by the C++ preprocessor)
Information of a single source file. Stored in field parsedFileNameCache.
NCString origFile
Path and name of source file (given by the C++ preprocessor).
NString trimmedPathPrefix
NString name
File name (evaluated).
NString nameWOExt
File name without extension (evaluated).
integer origFilePathLength
Index of last path separator in origFile.
NString fullPath
Full path of source file (evaluated).
ParsedFileName(const NCString filename)
NString trimmedPath
Trimmed path of source file (evaluated).
int TrimOffset
Additional offset of the trim position.
lang::Inclusion IncludeString
Denotes if Path itself should be included when trimmed.
variables::Priority Priority
The priority of the rule. Depends on origin: source code, config...)
bool IsPrefix
true if path was not starting with '*', when provided.
lang::Case Sensitivity
The sensitivity of the comparison when trimming.
NAString Path
The path string.
NAString TrimReplacement
Optional replacement string for trimmed paths.
Serves as template parameter TValueDescriptor of field parsedFileNameCache.
NCString Key(ParsedFileName &src) const