Copyright | Copyright © 2015 PivotCloud Inc. |
---|---|
License | Apache-2.0 |
Maintainer | Lars Kuhtz <lkuhtz@pivotmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
This module re-exports the logger interface from System.Logger.Types and the implementation of that interface from System.Logger.Logger and System.Logger.Backend.Handle.
Synopsis
- withConsoleLogger :: (MonadIO m, MonadBaseControl IO m) => LogLevel -> LoggerT Text m α -> m α
- withFileLogger :: (MonadIO m, MonadBaseControl IO m) => FilePath -> LogLevel -> LoggerT Text m α -> m α
- module System.Logger.Types
- module System.Logger.Logger
- module System.Logger.Backend.Handle
- data LogConfig = LogConfig {}
- logConfigLogger :: Lens' LogConfig LoggerConfig
- logConfigBackend :: Lens' LogConfig HandleBackendConfig
- defaultLogConfig :: LogConfig
- validateLogConfig :: ConfigValidation LogConfig []
- pLogConfig :: MParser LogConfig
- pLogConfig_ :: Text -> MParser LogConfig
Documentation
withConsoleLogger :: (MonadIO m, MonadBaseControl IO m) => LogLevel -> LoggerT Text m α -> m α Source #
A simple console logger
import System.Logger main ∷ IO () main = withConsoleLogger Info $ do logg Info "moin" withLabel ("function", "f") f logg Warn "tschüss" where f = withLevel Debug $ do logg Debug "debug f"
withFileLogger :: (MonadIO m, MonadBaseControl IO m) => FilePath -> LogLevel -> LoggerT Text m α -> m α Source #
A simple file logger
Logger Interface
module System.Logger.Types
Yet Another Logger
module System.Logger.Logger
Handle Backend
module System.Logger.Backend.Handle
Logging System Configuration
Instances
Eq LogConfig Source # | |
Ord LogConfig Source # | |
Defined in System.Logger | |
Read LogConfig Source # | |
Show LogConfig Source # | |
Generic LogConfig Source # | |
ToJSON LogConfig Source # | |
Defined in System.Logger | |
FromJSON (LogConfig -> LogConfig) Source # | |
type Rep LogConfig Source # | |
Defined in System.Logger type Rep LogConfig = D1 (MetaData "LogConfig" "System.Logger" "yet-another-logger-0.3.1-9xkv1iYSnq3IJ3TK3FoqRe" False) (C1 (MetaCons "LogConfig" PrefixI True) (S1 (MetaSel (Just "_logConfigLogger") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 LoggerConfig) :*: S1 (MetaSel (Just "_logConfigBackend") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 HandleBackendConfig))) |
A version of pLogConfig
that takes a prefix for the command
line option.
Since: yet-another-logger-0.2