Class BaseLogger (1.50.0)

public abstract class BaseLogger : object, ILogger

An abstract base logger, upon which real loggers may be built.

Inheritance

Object > BaseLogger

Implements

ILogger

Derived Types

Namespace

Google.Apis.Logging

Assembly

Google.Apis.Core.dll

Constructors

BaseLogger(LogLevel, IClock, Type)

protected BaseLogger(LogLevel minimumLogLevel, IClock clock, Type forType)

Construct a BaseLogger.

Parameters
NameDescription
minimumLogLevelLogLevel

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

clockIClock

The IClock to use to timestamp log entries.

forTypeType

The type from which entries are being logged. May be null.

Properties

Clock

public IClock Clock { get; }

The IClock being used to timestamp log entries.

Property Value
TypeDescription
IClock

IsDebugEnabled

public bool IsDebugEnabled { get; }

Is Debug level logging enabled?

Property Value
TypeDescription
Boolean

IsErrorEnabled

public bool IsErrorEnabled { get; }

Is error level logging enabled?

Property Value
TypeDescription
Boolean

IsInfoEnabled

public bool IsInfoEnabled { get; }

Is info level logging enabled?

Property Value
TypeDescription
Boolean

IsWarningEnabled

public bool IsWarningEnabled { get; }

Is warning level logging enabled?

Property Value
TypeDescription
Boolean

LoggerForType

public Type LoggerForType { get; }

The type from which entries are being logged. May be null.

Property Value
TypeDescription
Type

MinimumLogLevel

public LogLevel MinimumLogLevel { get; }

Logging is enabled at this level and all higher levels.

Property Value
TypeDescription
LogLevel

Methods

BuildNewLogger(Type)

protected abstract 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.

Debug(String, Object[])

public void Debug(string message, params object[] formatArgs)

Logs a debug message.

Parameters
NameDescription
messageString

The message to log.

formatArgsObject[]

String.Format arguments (if applicable).

Error(Exception, String, Object[])

public void Error(Exception exception, string message, params object[] formatArgs)

Logs an error message resulting from an exception.

Parameters
NameDescription
exceptionException
messageString

The message to log.

formatArgsObject[]

String.Format arguments (if applicable).

Error(String, Object[])

public void Error(string message, params object[] formatArgs)

Logs an error message.

Parameters
NameDescription
messageString

The message to log.

formatArgsObject[]

String.Format arguments (if applicable).

ForType(Type)

public ILogger ForType(Type type)

Returns a logger which will be associated with the specified type.

Parameter
NameDescription
typeType

Type to which this logger belongs.

Returns
TypeDescription
ILogger

A type-associated logger.

ForType<T>()

public ILogger ForType<T>()

Returns a logger which will be associated with the specified type.

Returns
TypeDescription
ILogger

A type-associated logger.

Type Parameter
NameDescription
T

Info(String, Object[])

public void Info(string message, params object[] formatArgs)

Logs an info message.

Parameters
NameDescription
messageString

The message to log.

formatArgsObject[]

String.Format arguments (if applicable).

Log(LogLevel, String)

protected abstract 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.

Warning(String, Object[])

public void Warning(string message, params object[] formatArgs)

Logs a warning.

Parameters
NameDescription
messageString

The message to log.

formatArgsObject[]

String.Format arguments (if applicable).

Extension Method