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.
Public Fields | |
HashMap< Long, String > | threadDictionary = new HashMap<Long, String>() |
Ticks | timeStamp = new Ticks() |
Public Methods | |
ScopeInfo (String name, Vector< String > omittablePackagePrefixes) | |
AString | getClassName () |
AString | getFileName () |
int | getLineNumber () |
String | getLoxName () |
AString | getMethodName () |
AString | getPackageName () |
Thread | getThread () |
long | getThreadID () |
AString | getThreadName () |
void | release () |
void | set (Thread thread) |
Private Fields | |
AString | className = new AString(32) |
AString | fileName = new AString(32) |
boolean | lazyStackTrace = true |
int | lineNumber |
String | loxName |
AString | methodName = new AString(32) |
Vector< String > | omittablePackagePrefixes |
AString | packageName = new AString(32) |
Thread | thread |
AString | threadName = new AString(32) |
Private Methods | |
void | updateStackTrace () |
ScopeInfo | ( | String | name, |
Vector< String > | omittablePackagePrefixes | ||
) |
Constructs a scope info.
name | The name of the Lox we belong to. Will be converted to upper case. |
omittablePackagePrefixes | A list of prefixes of package names that are ignored, when the calling method is identified from the top of the calling stack. |
AString getClassName | ( | ) |
Receives the callees class name.
AString getFileName | ( | ) |
Receives the callees file name.
int getLineNumber | ( | ) |
Receives the callees line number.
String getLoxName | ( | ) |
AString getMethodName | ( | ) |
Receives the callees method name.
AString getPackageName | ( | ) |
Receives the callees package name.
Thread getThread | ( | ) |
Receives the ID of the thread executing the scope.
long getThreadID | ( | ) |
Receives the ID of the thread executing the scope.
AString getThreadName | ( | ) |
Receives the name of the thread executing the scope. If a mapping exists, the mapped name is returned
void release | ( | ) |
Releases latest scope information.
void set | ( | Thread | thread | ) |
Stores parameters and sets actual time stamp.
thread | The thread executing a log statement. If null , it will be determined if needed. |
|
private |
Retrieves the scope information from a stack trace when field lazyStackTrace is true.
|
private |
Flag that indicates whether stack trace information was retrieved already (false) or not (true).
|
private |
The line number within the source file where the log call is placed in.
|
private |
The name of the Lox we are attached to
|
private |
A reference to list of prefixes of 'packages.classes.methods' maintained by our lox
Name and path of the source code file the log call is placed in.
|
private |
The thread that invoked the call.
HashMap<Long, String> threadDictionary = new HashMap<Long, 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.
Name and path of the source code file the log call is placed in.