Show / Hide Table of Contents

Class MemoryLogger

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

Inheritance
object
BaseLogger
MemoryLogger
Inherited Members
BaseLogger.Clock
BaseLogger.LoggerForType
BaseLogger.MinimumLogLevel
BaseLogger.IsDebugEnabled
BaseLogger.IsInfoEnabled
BaseLogger.IsWarningEnabled
BaseLogger.IsErrorEnabled
BaseLogger.ForType<T>()
BaseLogger.ForType(Type)
BaseLogger.Debug(string, params object[])
BaseLogger.Info(string, params object[])
BaseLogger.Warning(string, params object[])
BaseLogger.Error(Exception, string, params object[])
BaseLogger.Error(string, params object[])
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Logging
Assembly: Google.Apis.Core.dll
Syntax
public sealed class MemoryLogger : BaseLogger

Constructors

MemoryLogger(LogLevel, int, IClock)

Construct a MemoryLogger.

Declaration
public MemoryLogger(LogLevel minimumLogLevel, int maximumEntryCount = 1000, IClock clock = null)
Parameters
Type Name Description
LogLevel minimumLogLevel

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

int maximumEntryCount

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

IClock clock

Optional IClock; will use the system clock if null.

Properties

LogEntries

The list of log entries.

Declaration
public IList<string> LogEntries { get; }
Property Value
Type Description
IList<string>

Methods

BuildNewLogger(Type)

Build a new logger of the derived concrete type, for use to log from the specified type.

Declaration
protected override ILogger BuildNewLogger(Type type)
Parameters
Type Name Description
Type type

The type from which entries are being logged.

Returns
Type Description
ILogger

A new ILogger instance, logging from the specified type.

Overrides
BaseLogger.BuildNewLogger(Type)

Log(LogLevel, string)

Perform the actual logging.

Declaration
protected override void Log(LogLevel logLevel, string formattedMessage)
Parameters
Type Name Description
LogLevel logLevel

The LogLevel of this log entry.

string formattedMessage

The fully formatted log message, ready for logging.

Overrides
BaseLogger.Log(LogLevel, string)

Extension Methods

Utilities.ThrowIfNull<T>(T, string)
In this article
Back to top Generated by DocFX