heavy-logger-0.3.2.1: Full-weight logging based on fast-logger

Safe HaskellNone
LanguageHaskell2010

System.Log.Heavy.Backends.Dynamic

Contents

Description

This module incldues logging backend combinators that allow to change underlying backend or it's settings in runtime.

Synopsis

Dynamic backend

data DynamicBackend Source #

Dynamic logging backend allows to change logging backend or it's settings in runtime. When it sees new backend settings, it deinitializes old backend and initializes new one.

How to use it:

  • Before creating DynamicSettings, you have to select some initial LoggingSettings and create DynamicBackendHandle with it.
  • When you decide that you want to use new backend settings, call updateDynamicBackendSettings on existing DynamicBackendHandle. DynamicBackend will use new settings for the next logging function call.
  • It is responsibility of caller code to do not change backends too frequently; for example, if you are checking your config file for updates of logging settings each 10s, you have to check that settings actually changed since last time.

It is possible to create one instance of DynamicBackendHandle and pass it to multiple threads.

data DynamicBackendHandle Source #

Abstract handle, that is used to control DynamicBackend.

newDynamicBackendHandle Source #

Arguments

:: LoggingSettings

Initial logging settings. This can be changed later with updateDynamicBackendSettings.

-> IO DynamicBackendHandle 

Create an instance of DynamicBackendHandle.

updateDynamicBackendSettings Source #

Arguments

:: DynamicBackendHandle

Handle of DynamicBackend.

-> LoggingSettings

New logging settings.

-> IO () 

Update settings of DynamicBackend, which was created by provided handle.

data family LogBackendSettings b Source #

Logging backend settings data type

Instances
data LogBackendSettings AnyLogBackend Source # 
Instance details

Defined in System.Log.Heavy.Types

data LogBackendSettings DynamicBackend Source # 
Instance details

Defined in System.Log.Heavy.Backends.Dynamic

data LogBackendSettings NullBackend Source # 
Instance details

Defined in System.Log.Heavy.Backends

data LogBackendSettings ParallelBackend Source # 
Instance details

Defined in System.Log.Heavy.Backends

data LogBackendSettings ChanLoggerBackend Source # 
Instance details

Defined in System.Log.Heavy.Backends

data LogBackendSettings SyslogBackend Source # 
Instance details

Defined in System.Log.Heavy.Backends

data LogBackendSettings FastLoggerBackend Source # 
Instance details

Defined in System.Log.Heavy.Backends

data LogBackendSettings (FilteringM b) Source # 
Instance details

Defined in System.Log.Heavy.Backends.Dynamic

data LogBackendSettings (Filtering b) Source # 
Instance details

Defined in System.Log.Heavy.Backends

Dynamic filtering

filteringM :: IsLogBackend b => LogFilter -> LogBackendSettings b -> IO (LogBackendSettings (FilteringM b)) Source #

Specify filter as LogFilter. This filter can be changed later.

excludingM :: IsLogBackend b => LogFilter -> LogBackendSettings b -> IO (LogBackendSettings (FilteringM b)) Source #

Exclude messages by filter. This filter can be changed later.