Show / Hide Table of Contents

Class ConsoleLogger

A logger than logs to StdError or StdOut.

Inheritance
System.Object
BaseLogger
ConsoleLogger
Implements
ILogger
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, Object[])
BaseLogger.Info(String, Object[])
BaseLogger.Warning(String, Object[])
BaseLogger.Error(Exception, String, Object[])
BaseLogger.Error(String, Object[])
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Logging
Assembly: Google.Apis.Core.dll
Syntax
public sealed class ConsoleLogger : BaseLogger, ILogger

Constructors

ConsoleLogger(LogLevel, Boolean, IClock)

Construct a ConsoleLogger.

Declaration
public ConsoleLogger(LogLevel minimumLogLevel, bool logToStdOut = false, IClock clock = null)
Parameters
Type Name Description
LogLevel minimumLogLevel

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

System.Boolean logToStdOut

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

IClock clock

Optional IClock; will use the system clock if null.

Properties

LogToStdOut

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

Declaration
public bool LogToStdOut { get; }
Property Value
Type Description
System.Boolean

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
System.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.

System.String formattedMessage

The fully formatted log message, ready for logging.

Overrides
BaseLogger.Log(LogLevel, String)

Implements

ILogger

Extension Methods

Utilities.ThrowIfNull<T>(T, String)
Back to top