FakeLogger Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A logger which captures everything logged to it and enables inspection.
public ref class FakeLogger : Microsoft::Extensions::Logging::ILogger
public class FakeLogger : Microsoft.Extensions.Logging.ILogger
type FakeLogger = class
interface ILogger
Public Class FakeLogger
Implements ILogger
- Inheritance
-
FakeLogger
- Derived
- Implements
Remarks
This type is intended for use in unit tests. It captures all the log state to memory and lets you inspect it to validate that your code is logging what it should.
Constructors
FakeLogger(Action<String>, String) |
Initializes a new instance of the FakeLogger class that copies all log records to the given output sink. |
FakeLogger(FakeLogCollector, String) |
Initializes a new instance of the FakeLogger class. |
Properties
Category |
Gets this logger's category, as specified when the logger was created. |
Collector |
Gets the logger collector associated with this logger, as specified when the logger was created. |
LatestRecord |
Gets the latest record logged to this logger. |
Methods
BeginScope<TState>(TState) |
Begins a logical operation scope. |
ControlLevel(LogLevel, Boolean) |
Controls the enabled state of a log level. |
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
IsEnabled(LogLevel) |
Checks if the given log level is enabled. |
Log<TState>(LogLevel, EventId, TState, Exception, Func<TState,Exception,String>) |
Creates a new log record. |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |