Class ActivityMonitorLogData
Data required by UnfilteredLog(ActivityMonitorLogData). This is also the base class for ActivityMonitorGroupData.
Inherited Members
Namespace: CK.Core
Assembly: CK.ActivityMonitor.dll
Syntax
public class ActivityMonitorLogData
Constructors
| Improve this Doc View SourceActivityMonitorLogData(LogLevel, Exception, CKTrait, String, DateTimeStamp, String, Int32)
Initializes a new ActivityMonitorLogData.
Declaration
public ActivityMonitorLogData(LogLevel level, Exception exception, CKTrait tags, string text, DateTimeStamp logTime, string fileName, int lineNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| LogLevel | level | Log level. Can not be None. |
| Exception | exception | Exception of the log. Can be null. |
| CK.Core.CKTrait | tags | Tags (from ActivityMonitor.Tags) to associate to the log. It will be union-ed with the current AutoTags. |
| String | text | Text of the log. Can be null or empty only if exception is not null: the Exception.Message is the text. |
| CK.Core.DateTimeStamp | logTime | Time of the log. You can use CK.Core.DateTimeStamp.UtcNow or NextLogTime(IActivityMonitor) extension method. |
| String | fileName | Name of the source file that emitted the log. Can be null. |
| Int32 | lineNumber | Line number in the source file that emitted the log. |
ActivityMonitorLogData(LogLevel, String, Int32)
Preinitializes a new ActivityMonitorLogData: Initialize(String, Exception, CKTrait, DateTimeStamp) has yet to be called.
Declaration
public ActivityMonitorLogData(LogLevel level, string fileName, int lineNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| LogLevel | level | Log level. Can be None (the log will be ignored). |
| String | fileName | Name of the source file that emitted the log. Can be null. |
| Int32 | lineNumber | Line number in the source file that emitted the log. |
Fields
| Improve this Doc View SourceFileName
Name of the source file that emitted the log. Can be null.
Declaration
public readonly string FileName
Field Value
| Type | Description |
|---|---|
| String |
Level
Log level. Can not be None. If the log has been successfully filtered, the IsFiltered bit flag is set.
Declaration
public readonly LogLevel Level
Field Value
| Type | Description |
|---|---|
| LogLevel |
LineNumber
Line number in the source file that emitted the log. Can be null.
Declaration
public readonly int LineNumber
Field Value
| Type | Description |
|---|---|
| Int32 |
MaskedLevel
The actual level (Trace to Fatal) associated to this group without IsFiltered bit flag.
Declaration
public readonly LogLevel MaskedLevel
Field Value
| Type | Description |
|---|---|
| LogLevel |
Properties
| Improve this Doc View SourceException
Exception of the log. Can be null.
Declaration
public Exception Exception { get; }
Property Value
| Type | Description |
|---|---|
| Exception |
ExceptionData
Gets the CK.Core.CKExceptionData that captures exception information if it exists. Returns null if no Exception exists.
Declaration
public CKExceptionData ExceptionData { get; }
Property Value
| Type | Description |
|---|---|
| CK.Core.CKExceptionData |
IsFilteredLog
Gets whether this log data has been successfully filtered (otherwise it is an unfiltered log).
Declaration
public bool IsFilteredLog { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
IsTextTheExceptionMessage
Gets whether the Text is actually the Exception message.
Declaration
public bool IsTextTheExceptionMessage { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
LogTime
Gets the time of the log.
Declaration
public DateTimeStamp LogTime { get; }
Property Value
| Type | Description |
|---|---|
| CK.Core.DateTimeStamp |
Tags
Tags (from ActivityMonitor.Tags) associated to the log. It will be union-ed with the current AutoTags.
Declaration
public CKTrait Tags { get; }
Property Value
| Type | Description |
|---|---|
| CK.Core.CKTrait |
Text
Text of the log. Can not be null.
Declaration
public string Text { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
| Improve this Doc View SourceEnsureExceptionData()
Gets or creates the CK.Core.CKExceptionData that captures exception information. If Exception is null, this returns null.
Declaration
public CKExceptionData EnsureExceptionData()
Returns
| Type | Description |
|---|---|
| CK.Core.CKExceptionData | A data representation of the exception or null. |
Initialize(String, Exception, CKTrait, DateTimeStamp)
Initializes this data.
Declaration
public void Initialize(string text, Exception exception, CKTrait tags, DateTimeStamp logTime)
Parameters
| Type | Name | Description |
|---|---|---|
| String | text | Text of the log. Can be null or empty: if exception is not null, the Message becomes the text otherwise NoLogText is used. |
| Exception | exception | Exception of the log. Can be null. |
| CK.Core.CKTrait | tags | Tags (from ActivityMonitor.Tags) to associate to the log. It will be union-ed with the current AutoTags. |
| CK.Core.DateTimeStamp | logTime | Time of the log. You can use CK.Core.DateTimeStamp.UtcNow or NextLogTime(IActivityMonitor) extension method. |