Class LogSource
This defines the "source" (origin) for log statements, it should have a Type or a identifier (string) so it's clear where the log entries come from. In general this should be instanciated with the default constructor without arguments, which takes care of initiating it. For normal .NET 4.5 this uses the Stack to find the type which called the constructor. For other platforms this uses the CallerFilePath, which supplies the source-file.
Inheritance
Inherited Members
Namespace:Dapplo.Log
Assembly:Dapplo.Log.dll
Syntax
public class LogSource
Constructors
| Improve this Doc View SourceLogSource(String)
The NON desktop default constructor which should be called without an argument. It will use the CallerFilePath attribute, to make sure the source file is passed as an argument.
Declaration
public LogSource(string sourceFilePath = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | sourceFilePath |
LogSource(Type)
The constructor for specifying the type manually
Declaration
public LogSource(Type callerType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | callerType | Type for the LogSource, not null |
Properties
| Improve this Doc View SourceShortSource
The Type, as string, where this LogSource was created Every part of the namespace is shortened to one letter. e.g. this class would return d.l.LogSource
Declaration
public string ShortSource { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Source
The Type, as string, where this LogSource was created e.g. this class would return Dapplo.Log.LogSource
Declaration
public string Source { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SourceType
The Type where this LogSource was created
Declaration
public Type SourceType { get; }
Property Value
Type | Description |
---|---|
System.Type |
Methods
| Improve this Doc View SourceForCustomSource(String)
Factory method where you can specify the type manually
Declaration
public static LogSource ForCustomSource(string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | source | A custom identifier for the LogSource |
Returns
Type | Description |
---|---|
LogSource | LogSource |