public sealed class MemoryLogger : BaseLogger, ILoggerA logger than logs to an in-memory buffer. Generally for use during tests.
Implements
ILoggerNamespace
GoogleApisLoggingAssembly
Google.Apis.Core.dll
Constructors
MemoryLogger(LogLevel, int, IClock)
public MemoryLogger(LogLevel minimumLogLevel, int maximumEntryCount = 1000, IClock clock = null)Construct a MemoryLogger.
| Parameters | |
|---|---|
| Name | Description |
minimumLogLevel |
LogLevelLogging will be enabled at this level and all higher levels. |
maximumEntryCount |
intThe maximum number of log entries. Further log entries will be silently discarded. |
clock |
IClockOptional IClock; will use the system clock if |
Properties
LogEntries
public IList<string> LogEntries { get; }The list of log entries.
| Property Value | |
|---|---|
| Type | Description |
IListstring |
|
Methods
BuildNewLogger(Type)
protected override ILogger BuildNewLogger(Type type)Build a new logger of the derived concrete type, for use to log from the specified type.
| Parameter | |
|---|---|
| Name | Description |
type |
TypeThe type from which entries are being logged. |
| Returns | |
|---|---|
| Type | Description |
ILogger |
A new ILogger instance, logging from the specified type. |
Log(LogLevel, string)
protected override void Log(LogLevel logLevel, string formattedMessage)Perform the actual logging.
| Parameters | |
|---|---|
| Name | Description |
logLevel |
LogLevelThe LogLevel of this log entry. |
formattedMessage |
stringThe fully formatted log message, ready for logging. |