Class BaseLogger (1.69.0)

 public abstract class BaseLogger 

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

Inheritance

object > BaseLogger

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
Name
Description
minimumLogLevel
LogLevel

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

clock
IClock

The IClock to use to timestamp log entries.

forType
Type

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
Type
Description

IsDebugEnabled

 public bool IsDebugEnabled { get; } 

Is Debug level logging enabled?

Property Value
Type
Description

IsErrorEnabled

 public bool IsErrorEnabled { get; } 

Is error level logging enabled?

Property Value
Type
Description

IsInfoEnabled

 public bool IsInfoEnabled { get; } 

Is info level logging enabled?

Property Value
Type
Description

IsWarningEnabled

 public bool IsWarningEnabled { get; } 

Is warning level logging enabled?

Property Value
Type
Description

LoggerForType

 public Type LoggerForType { get; } 

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

Property Value
Type
Description

MinimumLogLevel

 public LogLevel MinimumLogLevel { get; } 

Logging is enabled at this level and all higher levels.

Property Value
Type
Description

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
Name
Description
type
Type

The type from which entries are being logged.

Returns
Type
Description

A new ILogger instance, logging from the specified type.

Debug(string, params object[])

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

Logs a debug message.

Parameters
Name
Description
message
string

The message to log.

formatArgs
object

String.Format arguments (if applicable).

Error(Exception, string, params object[])

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

Logs an error message resulting from an exception.

Parameters
Name
Description
exception
message
string

The message to log.

formatArgs
object

String.Format arguments (if applicable).

Error(string, params object[])

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

Logs an error message.

Parameters
Name
Description
message
string

The message to log.

formatArgs
object

String.Format arguments (if applicable).

ForType(Type)

  public 
  
 ILogger 
  
 ForType 
 ( 
 Type 
  
 type 
 ) 
 

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

Parameter
Name
Description
type
Type

Type to which this logger belongs.

Returns
Type
Description

A type-associated logger.

ForType<T>()

 public ILogger ForType<T>() 

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

Returns
Type
Description

A type-associated logger.

Type Parameter
Name
Description
T

Info(string, params object[])

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

Logs an info message.

Parameters
Name
Description
message
string

The message to log.

formatArgs
object

String.Format arguments (if applicable).

Log(LogLevel, string)

 protected abstract void Log(LogLevel logLevel, string formattedMessage) 

Perform the actual logging.

Parameters
Name
Description
logLevel
LogLevel

The LogLevel of this log entry.

formattedMessage
string

The fully formatted log message, ready for logging.

Warning(string, params object[])

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

Logs a warning.

Parameters
Name
Description
message
string

The message to log.

formatArgs
object

String.Format arguments (if applicable).

Extension Method

Design a Mobile Site
View Site in Mobile | Classic
Share by: