Class ConsoleLogger (1.55.0)

public sealed class ConsoleLogger : BaseLogger, ILogger

A logger than logs to StdError or StdOut.

Inheritance

Object > BaseLogger > ConsoleLogger

Implements

ILogger

Namespace

Google.Apis.Logging

Assembly

Google.Apis.Core.dll

Constructors

ConsoleLogger(LogLevel, Boolean, IClock)

public ConsoleLogger(LogLevel minimumLogLevel, bool logToStdOut = false, IClock clock = null)

Construct a ConsoleLogger.

Parameters
NameDescription
minimumLogLevelLogLevel

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

logToStdOutBoolean

true to log to StdOut, defaults to logging to StdError.

clockIClock

Optional IClock; will use the system clock if null.

Properties

LogToStdOut

public bool LogToStdOut { get; }

false to log to StdError; true to log to StdOut.

Property Value
TypeDescription
Boolean

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