8#ifndef HPP_ALIB_LOX_DETAIL_SCOPEINFO
9#define HPP_ALIB_LOX_DETAIL_SCOPEINFO 1
11#if !defined(HPP_ALIB_LOX_PROPPERINCLUDE)
12# error "ALib sources with ending '.inl' must not be included from outside."
30namespace lox {
namespace detail {
256 const NString& trimReplacement,
286 if( srcFile.fullPath.IsNull() )
290 srcFile.fullPath=
NString( srcFile.origFile.Buffer(), idx );
292 srcFile.fullPath=
"";
295 return srcFile.fullPath;
306 if( srcFile.trimmedPath.IsNull() )
309 target.
_( srcFile.trimmedPathPrefix )
310 .
_( srcFile.trimmedPath );
320 if( srcFile.name.IsNull() )
326 srcFile.name=
NString( srcFile.origFile.Buffer() + idx + 1,
327 srcFile.origFile.Length() - idx - 1 );
344 if( srcFile.nameWOExt.IsNull() )
347 integer lastDot= srcFile.nameWOExt.LastIndexOf(
'.' );
349 srcFile.nameWOExt=
NString( srcFile.nameWOExt.Buffer(), lastDot );
351 return srcFile.nameWOExt;
461 if( srcFile.origFilePathLength == -2 )
463 return srcFile.origFilePathLength;
Iterator Find(const KeyType &key)
NString loxName
The name of the Lox we are attached to.
const NCString & GetOrigFile()
std::vector< SourcePathTrimRule > LocalSPTRs
List of trim definitions for portions of source paths to be ignored.
StdVectorMono< FrameRecord > callStack
A stack of scopes (allows recursive calls/nested logging).
threads::ThreadID GetThreadID()
const NString GetFullPath()
static ALIB_API std::vector< SourcePathTrimRule > GlobalSPTRs
List of trim definitions for portions of source paths to be ignored.
const NString GetFileName()
static ALIB_API bool GlobalSPTRsReadFromConfig
Flag to determine if global rules have been read from config already.
const alib::String & GetThreadNameAndID(threads::ThreadID *id)
void SetFileNameCacheCapacity(integer numberOfLists, integer entriesPerList)
ThreadDictionary threadDictionary
std::thread::id GetThreadNativeID()
const NCString GetMethod()
Thread * thread
The thread passed with Set.
ALIB_API void Set(const lang::CallerInfo &ci)
std::thread::id threadNativeIDx
The C++ native ID.
int callStackSize
The current depth of recursive invocations.
const NString GetFileNameWithoutExtension()
void PopNestedScope()
Releases latest scope information.
ALIB_API void SetSourcePathTrimRule(const NCString &path, lang::Inclusion includeString, int trimOffset, lang::Case sensitivity, const NString &trimReplacement, lang::Reach reach, Priority priority)
String threadName
The name of the thread that executed the log.
const NString GetLoxName()
bool AutoDetectTrimableSourcePath
const std::type_info * GetTypeInfo()
void GetTrimmedPath(AString &target)
LRUCacheTable< MonoAllocator, ValueDescriptorPFN, std::hash< NString > > parsedFileNameCache
Least recently used cache of parsed file name.
ALIB_API ScopeInfo(const NString &name, MonoAllocator &allocator)
TAString & _(const TString< TChar > &src, integer regionStart, integer regionLength=MAX_LEN)
constexpr bool IsNull() const
virtual const CString GetName() const
static ALIB_API Thread * Get(std::thread::id nativeID)
#define ALIB_WARNINGS_RESTORE
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
#define ALIB_ASSERT(cond)
static constexpr PathCharType DIRECTORY_SEPARATOR
The standard path separator character. Defaults to '\' on Windows OS, '/' else.
Inclusion
Denotes how members of a set something should be taken into account.
Reach
Denotes the reach of something.
Case
Denotes upper and lower case character treatment.
integer ThreadID
The ALib thread identifier type.
std::vector< T, SCAMono< T > > StdVectorMono
Type alias in namespace alib.
strings::TString< nchar > NString
Type alias in namespace alib.
config::Variable Variable
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
static ALIB_API void GetState(LoxImpl *impl, NAString &buf, StateInfo flags)
static ALIB_API void MapThreadName(LoxImpl *impl, const String &threadName, threads::ThreadID id)
Ticks timeStamp
Time of the call that created this record.
ParsedFileName * Parsed
The entry from the parsedFileNameCache.
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)
int origLine
Line number within the source file (given by the C++ preprocessor)
Information of a single source file. Stored in field parsedFileNameCache.
NString trimmedPathPrefix
NCString origFile
Path and name of source file (given by the C++ preprocessor).
integer origFilePathLength
Index of last path separator in origFile.
NString nameWOExt
File name without extension (evaluated).
ParsedFileName(const NCString filename)
NString trimmedPath
Trimmed path of source file (evaluated).
NString name
File name (evaluated).
NString fullPath
Full path of source file (evaluated).
NAString TrimReplacement
Optional replacement string for trimmed paths.
int TrimOffset
Additional offset of the trim position.
lang::Inclusion IncludeString
Denotes if Path itself should be included when trimmed.
NAString Path
The path string.
lang::Case Sensitivity
The sensitivity of the comparison when trimming.
config::Priority Priority
The priority of the rule. Depends on origin: source code, config...)
bool IsPrefix
true if path was not starting with '*', when provided.
Serves as template parameter TValueDescriptor of field parsedFileNameCache.
NCString Key(ParsedFileName &src) const