Encapsulates information of the caller that can be collected. This is platform specific, in this case, .NET 4.5. What we currently can get from the .NET compiler, is the source file name of the calling code, the line number within the source file name and the name of the method the call is placed. We do not get the class name of the object or even its instance.
Inner Classes | |
class | Scope |
class | SourceFile |
class | SourcePathTrimRule |
Public Static Fields | |
static int | DefaultCacheSize = 5 |
static List< SourcePathTrimRule > | GlobalSPTRs = new List<SourcePathTrimRule>() |
static bool | GlobalSPTRsReadFromConfig = false |
Public Fields | |
List< SourcePathTrimRule > | LocalSPTRs = new List<SourcePathTrimRule>() |
Dictionary< int, String > | threadDictionary =new Dictionary<int, String>() |
Public Methods | |
ScopeInfo (String name) | |
AString | GetFileName () |
AString | GetFileNameWithoutExtension () |
String | GetFullPath (out int length) |
int | GetLineNumber () |
String | GetLoxName () |
String | GetMethod () |
String | GetOrigFile () |
Thread | GetThread () |
int | GetThreadID () |
AString | GetThreadName () |
Ticks | GetTimeStamp () |
AString | GetTrimmedPath () |
void | Release () |
void | Set (int callerLineNumber, String callerSourceFileName, String callerMemberName, Thread thread) |
void | SetSourcePathTrimRule (String path, Inclusion includeString, int trimOffset, Case sensitivity, String trimReplacement, Reach reach, int priority) |
Protected Fields | |
int | actScopeDepth = -1 |
bool | AutoDetectTrimableSourcePath = true |
SourceFile[] | cache |
long | cacheRun = 0 |
int | cacheSize |
SourceFile | lastSourceFile |
String | loxName |
List< Scope > | scopes = new List<Scope>() |
Thread | thread |
int | threadID |
AString | threadName = new AString(32) |
|
inline |
Constructs a scope info.
name | The name of the Lox we belong to. Will be converted to upper case. |
|
inline |
Receives the source file name excluding the path (usually provided by System.Runtime.CompilerServices).
|
inline |
Receives the source file name excluding the path and without an extension (usually provided by System.Runtime.CompilerServices).
|
inline |
Returns the original path and filename of the source file, togehter with length, of the path within this string (as output parameter) .
[out] | length | Output parameter returning the length of the path string. |
|
inline |
Receives the source file line number (usually provided by System.Runtime.CompilerServices).
|
inline |
|
inline |
Receives the method name (usually provided by System.Runtime.CompilerServices).
|
inline |
Receives the original filename and path of the source file (usually provided by ).
|
inline |
Receives the thread of the caller.
|
inline |
Receives the thread ID of the caller.
|
inline |
Receives the translated name or, if not translated, "name(ID)" of the caller.
|
inline |
|
inline |
Tries to trim the source files' path. Sets variable SourceFile.trimmedPath to either the successfully trimmed path or to the non-trimmed one. This way, it is executed only once, at it is 'lazily' invoked by GetTrimmedPath()
|
inline |
Releases latest scope information.
|
inline |
Stores caller parameters, sets actual time stamp and receives thread information
callerLineNumber | Line number within the source code file the log call is placed in. |
callerSourceFileName | Name and path of the source code file the log call is placed in. |
callerMemberName | Name of the method the log call is placed in. |
thread | The thread. If null , it will be determined if needed. |
|
inline |
Does the job for Lox.SetSourcePathTrimRule and Lox.ClearSourcePathTrimRules.
path | The path to search for. If not starting with '*' , a prefix is searched. |
includeString | Determines if path should be included in the trimmed path or not. |
trimOffset | Adjusts the portion of path that is trimmed. 999999 to clear! |
sensitivity | Determines if the comparison of path with a source files' path is performed case sensitive or not. |
trimReplacement | Replacement string for trimmed portion of the path. |
reach | Denotes whether the rule is applied locally (to this Lox only) or applies to all instances of class Lox. |
priority | The priority of the setting. |
|
protected |
The current depth of recursive invocations.
|
protected |
If true, next time a source path can not be trimmed successfully with custom trim information provided with Lox.SetSourcePathTrimRule some trim information is automatically created by comparing such source files' path with the path of the executable of the current process.
|
protected |
A list of source files. The its size is dependent on static field DefaultCacheSize.
|
protected |
The 'timestamp' used to identify the LRU entry. Incremented, whenever a different source file is evaluated.
|
protected |
The number of source file path and corresponding, evaluated derived values. Determined in the constructor by reading static field DefaultCacheSize.
|
static |
The number of source file path and corresponding, evaluated derived values. This might be modified, prior to creating any object of class Lox.
Defaults to 5.
|
static |
List of trim definitions for portions of source paths to be ignored
|
static |
Flag to determine if global rules have been read from config already
|
protected |
The last source file used. This is tried first with next invocation. If it does not match, the cache is searched for another matching one.
List<SourcePathTrimRule> LocalSPTRs = new List<SourcePathTrimRule>() |
List of trim definitions for portions of source paths to be ignored
|
protected |
The name of the Lox we are attached to
A stack of scopes (allows recursive calls/nested logging)
|
protected |
The thread that executed the log.
Dictionary<int, String> threadDictionary =new Dictionary<int, String>() |
Dictionary to translate thread IDs into something maybe nicer/shorter. The dictionary may be filled by the user of the library using Lox.MapThreadName.
|
protected |
The id of the thread that executed the log.