This is central class of the ALox logging implementation. It is not recommended to use this class directly for logging. Instead, use the simple and convenient static interface class Log or, for release logging and other more complex operations use a Lox instance. The class is abstract. To implement an own log stream, derive a new Logger class and implement the abstract method Log.
Public Fields | |
int | CntLogs |
Ticks | TimeOfCreation = new Ticks() |
The creation time of the Logger. | |
Ticks | TimeOfLastLog = new Ticks() |
Timestamp of the last log operation. | |
Public Fields inherited from ThreadLock | |
int | RecursionWarningThreshold =10 |
int | waitWarningTimeLimitInMillis =1000 |
Public Methods | |
String | GetName () |
String | GetTypeName () |
abstract void | Log (Domain domain, Verbosity verbosity, List< Object > logables, ScopeInfo scope) |
override String | ToString () |
Public Methods inherited from SmartLock | |
SmartLock () | |
virtual int | AddAcquirer (ThreadLock newAcquirer) |
int | CntAcquirers () |
virtual int | RemoveAcquirer (ThreadLock acquirerToRemove) |
Public Methods inherited from ThreadLock | |
ThreadLock (LockMode lockMode=LockMode.Recursive, Safeness safeness=Safeness.Safe) | |
virtual void | Acquire ([CallerLineNumber] int cln=0,[CallerFilePath] String csf="",[CallerMemberName] String cmn="") |
int | DbgCountAcquirements (Thread thread=null) |
LockMode | GetMode () |
Safeness | GetSafeness () |
virtual void | Release () |
void | SetSafeness (Safeness safeness) |
override String | ToString () |
bool | WillRelease () |
Protected Fields | |
String | Name |
String | TypeName |
Protected Fields inherited from SmartLock | |
List< ThreadLock > | acquirers =new List<ThreadLock>() |
Protected Fields inherited from ThreadLock | |
int | cntAcquirements |
LockMode | lockMode |
Object | mutex |
Thread | owner |
Ticks | waitTime =new Ticks() |
Protected Methods | |
Logger (String name, String typeName) | |
|
inlineprotected |
|
inline |
Returns the name of this logger. The name has to be unique for all Loggers attached to a Lox.
|
inline |
Returns the constant type name of this logger. The type name is defined by the class and hence provides a sort of runtime type information.
|
pure virtual |
This is the central method that derived logger classes have to implement to log a message. When it is invoked the Log Domain's Verbosity was already checked against parameter verbosity. The only action to take is to perform the log itself.
Parameter logables contains at least one object, the one provided with the log statement. Other objects that might be included in the list, are Prefix Objects corresponding to the scope.
domain | The Log Domain. |
verbosity | The verbosity. |
logables | The list of objects to log. |
scope | Information about the scope of the Log Statement. |
Implemented in TextLogger.
|
inline |
This is for debugging purposes. E.g. this enables the Monodevelop IDE to display object descriptions in the debugger.
int CntLogs |
The number of logs actually performed so far. In a text logger this is similar to the line number, despite the fact that a single log call can produce more than one line.
|
protected |
|
protected |
The type name of the Logger. This is set by the derived class similar to the class name.