Class MemoryLogger (1.55.0)

public sealed class MemoryLogger : BaseLogger, ILogger

A logger than logs to an in-memory buffer. Generally for use during tests.

Inheritance

Object > BaseLogger > MemoryLogger

Implements

ILogger

Namespace

Google.Apis.Logging

Assembly

Google.Apis.Core.dll

Constructors

MemoryLogger(LogLevel, Int32, IClock)

public MemoryLogger(LogLevel minimumLogLevel, int maximumEntryCount = 1000, IClock clock = null)

Construct a MemoryLogger.

Parameters
NameDescription
minimumLogLevelLogLevel

Logging will be enabled at this level and all higher levels.

maximumEntryCountInt32

The maximum number of log entries. Further log entries will be silently discarded.

clockIClock

Optional IClock; will use the system clock if null.

Properties

LogEntries

public IList<string> LogEntries { get; }

The list of log entries.

Property Value
TypeDescription
IList<String>

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
NameDescription
typeType

The type from which entries are being logged.

Returns
TypeDescription
ILogger

A new ILogger instance, logging from the specified type.

Overrides

Log(LogLevel, String)

protected override void Log(LogLevel logLevel, string formattedMessage)

Perform the actual logging.

Parameters
NameDescription
logLevelLogLevel

The LogLevel of this log entry.

formattedMessageString

The fully formatted log message, ready for logging.

Overrides

Extension Method