slf4d

The main module of SLF4D, which publicly imports all of the components that are typically needed in an application for logging. It also defines the global shared loggerFactory from which all application loggers are obtained.

Modules

default_provider
module slf4d.default_provider

This module defines the components of SLF4D's default logging provider, which will be used if no other provider is configured when the application starts.

factory
module slf4d.factory

This module defines the LoggerFactory, a component that's part of a LoggingProvider's implementation, and produces Logger instances to use at runtime.

handler
module slf4d.handler

The handler module defines the LogHandler interface, as well as several simple handler implementations that can be used or extended by SLF4D providers.

level
module slf4d.level

Defines the concept of a *Log Level*, that is, a quantifiable *severity* of a log message, which can be used to determine if such a message is shown, or where that message gets routed.

log_functions
module slf4d.log_functions

This module defines a set of logging functions that can be used in any application. There is a set of basic log functions that accept any logging level, as well as pre-defined functions for the standard SLF4D logging levels.

logger
module slf4d.logger

This module defines the Logger; the central component from which all log messages originate. You

noop_provider
module slf4d.noop_provider

An SLF4D logging provider that simply discards all log messages. This can be used during testing, if you'd like to suppress expected log messages.

provider
module slf4d.provider

Contains the specification for SLF4D providers to implement.

test
module slf4d.test

The test module defines some common components and imports that are useful for testing your application's logging behavior.

testing_provider
module slf4d.testing_provider

An SLF4D provider that is intended to be used for testing. The provider class, TestingLoggingProvider, includes some convenience methods to inspect the log messages generated while it's active.

writer
module slf4d.writer

This module defines the SerializingLogHandler, LogWriter interface, and associated components for writing serialized log messages to external systems.

Public Imports

slf4d.logger
public import slf4d.logger;
Undocumented in source.
slf4d.factory
public import slf4d.factory;
Undocumented in source.
slf4d.handler
public import slf4d.handler;
Undocumented in source.
slf4d.level
public import slf4d.level;
Undocumented in source.
slf4d.log_functions
public import slf4d.log_functions;
Undocumented in source.

Members

Functions

configureLoggingProvider
void configureLoggingProvider(LoggingProvider provider)

Configures SLF4D to use the given logging provider. Call this once on application startup. In order to improve runtime performance, access to this provider is **not** synchronized, so attempts to reconfigure the logging provider after startup may lead to undefined behavior.

getLogger
Logger getLogger(string name)

Gets a Logger using the configured logger factory. This is a shortcut for getLoggerFactory().getLogger().

getLoggerFactory
LoggerFactory getLoggerFactory()

Gets the global shared logger factory instance. If no provider has been explicitly configured, the slf4d.default_provider module's DefaultProvider is used.

getLoggingProvider
LoggingProvider getLoggingProvider()

Gets the global shared logging provider instance. If no provider has been explicitly configured via configureLoggingProvider, then SLF4D's default provider will be used (or testing provider for unit tests).

resetLoggingState
void resetLoggingState()

Resets the logging state. Call this after your test, if you configured the global shared logging provider.