Class NonGenericLoggerBase
Concrete abstract implementation of INonGenericLogger This is needed as Python can not inhert from interfaces and needs concrete objects
Namespace: Tableau.Migration.Interop.Logging
Assembly: Tableau.Migration.dll
Syntax
public abstract class NonGenericLoggerBase : ILogger, INonGenericLogger
Methods
BeginScope<TState>(TState)
Begins a logical operation scope.
Declaration
public IDisposable? BeginScope<TState>(TState state) where TState : notnull
Parameters
Type | Name | Description |
---|---|---|
TState | state | The identifier for the scope. |
Returns
Type | Description |
---|---|
IDisposable | An IDisposable that ends the logical operation scope on dispose. |
Type Parameters
Name | Description |
---|---|
TState | The type of the state to begin scope for. |
IsEnabled(LogLevel)
Checks if the given logLevel
is enabled.
Declaration
public abstract bool IsEnabled(LogLevel logLevel)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | logLevel | Level to be checked. |
Returns
Type | Description |
---|---|
bool |
|
Log(LogLevel, EventId, string, Exception?, string)
Writes a log entry with a pre-formatted state object.
Declaration
public abstract void Log(LogLevel logLevel, EventId eventId, string state, Exception? exception, string message)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | logLevel | Entry will be written on this level. |
EventId | eventId | Id of the event. |
string | state | The pre-formatted entry to be written. |
Exception | exception | The exception related to this entry. |
string | message | The pre-formatted message to write. |
Log<TState>(LogLevel, EventId, TState, Exception?, Func<TState, Exception?, string>)
Writes a log entry.
Declaration
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | logLevel | Entry will be written on this level. |
EventId | eventId | Id of the event. |
TState | state | The entry to be written. Can be also an object. |
Exception | exception | The exception related to this entry. |
Func<TState, Exception, string> | formatter | Function to create a string message of the |
Type Parameters
Name | Description |
---|---|
TState | The type of the object to be written. |