TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

interface ILogger in Tinman.Core.Logging

Base interface for classes that are used for categorized logging.

interface ILogger extends ILogMessageSource
  IPleaseIncludeInBinaryThanks

Attributes

Category

The category of this logger.

property Category { get }
type ILoggerCategory
value [not-null] The logger category.

FullName

Returns the full name of this logger.

property FullName { get }
type string
value [not-null] The full name.

MessageCount

Returns the number of well-known log message templates.

property MessageCount { get }
type int32
value [>=0] The number of message templates.

See also:

MessagePrepare

Name

Returns the name of this logger.

property Name { get }
type string
value [not-null] The name.

Severity

Sets or gets the log message severity that shall be emitted for this log message source.

property Severity { get }
type LogSeverity
value The log message severity.
inherited ILogMessageSource.Severity

Methods

AddHandler

Adds a log message handler to this log message source.

method AddHandler ([Owner] ILogMessageHandler handler, bool replace = false)
type ILogMessageSource
params handler [not-null] The handler to add.
  replace Replace existing handler if redundant (see remarks)?
returns [not-null] this
inherited ILogMessageSource.AddHandler

Remarks:

If there already is a handler which makes the given one redundant (see IsRedundant), one of the following actions is performed:

ChangeSeverity

Changes the log message severity of this log message source.

method ChangeSeverity (LogSeverity severity, bool descendants = false, bool ancestors = false)
params severity The new log message severity.
  descendants Also set all descendant log message sources to the given log message severity? Defaults to false.
  ancestors Set the log message severity of all ancestor log message sources to the given log message severity if less detailed? Defaults to false.
inherited ILogMessageSource.ChangeSeverity

IsEnabled

Checks if the given log severity is enabled for this logger.

method IsEnabled (LogSeverity severity)
type bool
params severity The log severity.
returns true if the log severity is enabled, false if it is disabled.

Message

Emits a log messages of the given severity.

method Message (LogSeverity severity, string message)
params severity The log message severity.
  message The log message to emit.

MessageAt

Returns the idx-th well-known log message template.

method MessageAt (int32 idx)
type ILogMessage
params idx [0..MessageCount-1] The message template index.
returns [not-null] The log message template.

MessagePrepare

Creates a new well-known log message template.

method MessagePrepare (string name, LogSeverity severity = LogSeverity.Common, string label = null)
type ILogMessage
params name [not-empty] The human-readable name that describes the template.
  severity The message severity. Defaults to Common.
  label The message label (see From) or null to use Any. Defaults to null.
returns [not-null] The log message template object.

PleaseIncludeInBinaryThanks

This is a no-op method that forces the compiler / linker to include this type in the resulting binary.

method PleaseIncludeInBinaryThanks ()
inherited IPleaseIncludeInBinaryThanks.PleaseIncludeInBinaryThanks

Remarks:

Calling this stub method makes sure that all lazy constructor calls have been made.

To initialize everything, an application needs to call this method on its root module(s) (see TinmanModule), followed by a call to PleaseIncludeInBinaryThanksAll.

RemoveHandler

Removes the given log message handle from this log message source.

method RemoveHandler (ILogMessageHandler handler)
type ILogMessageSource
params handler [not-null] The handler to remove.
returns [not-null] this
inherited ILogMessageSource.RemoveHandler

Extensions

Common

Emits a log messages of severity Common.

method Common (string message)
params message The log message to emit.

Debug

Emits a log messages of severity Debug.

method Debug (string message)
params message The log message to emit.

Error

Emits a log messages of severity Error.

method Error (string message)
params message The log message to emit.

Fatal

Emits a log messages of severity Fatal.

method Fatal (string message)
params message The log message to emit.

Info

Emits a log messages of severity Info.

method Info (string message)
params message The log message to emit.

IsCommonEnabled

Checks if the given log severity Common is enabled for this logger.

method IsCommonEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

IsDebugEnabled

Checks if the given log severity Common is enabled for this logger.

method IsDebugEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

IsErrorEnabled

Checks if the given log severity Common is enabled for this logger.

method IsErrorEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

IsFatalEnabled

Checks if the given log severity Common is enabled for this logger.

method IsFatalEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

IsInfoEnabled

Checks if the given log severity Common is enabled for this logger.

method IsInfoEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

IsTraceEnabled

Checks if the given log severity Trace is enabled for this logger.

method IsTraceEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

IsWarningEnabled

Checks if the given log severity Warning is enabled for this logger.

method IsWarningEnabled ()
type bool
returns true if the log severity is enabled, false if it is disabled.

Trace

Emits a log messages of severity Trace.

method Trace (string message)
params message The log message to emit.

Warning

Emits a log messages of severity Warning.

method Warning (string message)
params message The log message to emit.