Class HasLog
Base class for most objects which simply want to implement log and log-chaining.
Inheritance
System.Object
HasLog
Implements
Namespace: ToSic.Eav.Logging
Assembly: ToSic.Eav.Core.dll
Syntax
[InternalApi_DoNotUse_MayChangeWithoutNotice("this is just fyi")]
public abstract class HasLog : IHasLog
Constructors
| Improve this Doc View SourceHasLog(String, CodeRef, ILog, String)
Declaration
protected HasLog(string logName, CodeRef code, ILog parentLog = null, string initialMessage = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | logName | |
CodeRef | code | |
ILog | parentLog | |
System.String | initialMessage |
HasLog(String, ILog, String, String, String, Int32)
Constructor which ensures Log-chaining and optionally adds initial messages
Declaration
protected HasLog(string logName, ILog parentLog = null, string initialMessage = null, string cPath = null, string cName = null, int cLine = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | logName | Name to use in the Log-ID |
ILog | parentLog | Parent log (if available) for log-chaining |
System.String | initialMessage | First message to be added |
System.String | cPath | auto pre filled by the compiler - the path to the code file |
System.String | cName | auto pre filled by the compiler - the method name |
System.Int32 | cLine | auto pre filled by the compiler - the code line |
Properties
| Improve this Doc View SourceLog
The log object which contains the log and can add more logs to the list.
Declaration
[IgnoreDataMember]
public ILog Log { get; }
Property Value
Type | Description |
---|---|
ILog |
Methods
| Improve this Doc View SourceInitLog(String, ILog, String)
This is the real initializer - implemented as a virtual method, because some long-living objects must actively prevent logs from being attached.
Declaration
public virtual void InitLog(string name, ILog parentLog = null, string initialMessage = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
ILog | parentLog | |
System.String | initialMessage |
Remarks
this one can be overridden by outside sources, like the cache which should never allow attaching logs at runtime
InitLog(String, ILog, String, CodeRef)
Declaration
protected void InitLog(string name, ILog parentLog, string initialMessage, CodeRef code)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | |
ILog | parentLog | |
System.String | initialMessage | |
CodeRef | code |