HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulefast-logger-3.2.6Haskell2010

System.Log.FastLogger

This module provides a fast logging system which scales on multicore environments (i.e. +RTS -N<x>).

Note: This library does not guarantee correct ordering of log messages when program is run on more than one core thus users should rely more on message timestamps than on their order in the log.

  • 6 types
  • 1 class
  • 8 values
  • Packagefast-logger-3.2.6
  • Exports15
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFastLogger.hs

FastLogger

6 declarations
valuenewFastLogger :: LogType' v -> IO (v -> IO (), IO ())
#

Initialize a FastLogger without attaching timestamp a tuple of logger and clean up action are returned. This type signature should be read as:

newFastLogger :: LogType -> IO (FastLogger, IO ())

This logger uses numCapabilities many buffers, and thus does not provide time-ordered output. For time-ordered output, use newFastLogger1.

valuenewFastLogger1 :: LogType' v -> IO (v -> IO (), IO ())
#

Like newFastLogger, but creating a logger that uses only 1 internal builder. This scales less on multi-core machines and consumes more memory because of an internal queue but provides time-ordered output.

Timed FastLogger

3 declarations
typetype TimedFastLogger = (FormattedTime -> LogStr) -> IO ()
#

TimedFastLogger pass FormattedTime to callback and simply log its result. this can be used to customize how to log timestamp.

Usually, one would write a wrapper on top of TimedFastLogger, for example:

{-# LANGUAGE OverloadedStrings #-}

log :: TimedFastLogger -> LogStr -> IO ()
log logger msg = logger (\time -> toLogStr (show time) <> " " <> msg <> "\n")

Log messages

4 declarations
datadata LogStr
#

Log message builder. Use (<>) to append two LogStr in O(1).

Instances6Eq, Show, IsString, Semigroup, Monoid, ToLogStr
  • Eq LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • Show LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • IsString LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • Semigroup LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • Monoid LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
classclass ToLogStr msg where
#

Types that can be converted to a LogStr. Instances for types from the text library use a UTF-8 encoding. Instances for numerical types use a decimal encoding.

Methods

Instances21ToLogStr, …
  • ToLogStr BuilderDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr ByteStringDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr ByteStringDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr ShortByteStringDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr LogStrDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr IntegerDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr StringDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Int16Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Int32Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Int64Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Int8Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Word16Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Word32Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Word64Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr Word8Defined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr DoubleDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr FloatDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr IntDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr WordDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr TextDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr
  • ToLogStr TextDefined in fast-logger-3.2.6 · System.Log.FastLogger.LogStr

Buffer size

2 declarations
typetype BufSize = Int
#

The type for buffer size of each core.

LoggerSet

0 declarations

Date cache

0 declarations

File rotation

0 declarations

Types

0 declarations