Safe Haskell | None |
---|---|
Language | Haskell2010 |
System.Wlog.LogHandler.Roller
Description
Custom implementation of LogHandler
with log rotation support.
Synopsis
- newtype InvalidRotation = InvalidRotation Text
- data RollerHandler = RollerHandler {
- rhSeverities :: !Severities
- rhFormatter :: !(LogFormatter RollerHandler)
- rhFileHandle :: !(MVar Handle)
- rhWriteAction :: !(Handle -> Text -> IO ())
- rhCloseAction :: !(Handle -> IO ())
- rhFileName :: !FilePath
- logIndex :: FilePath -> Int -> FilePath
- rotationFileHandler :: MonadIO m => RotationParameters -> FilePath -> Severities -> m RollerHandler
Documentation
newtype InvalidRotation Source #
Constructors
InvalidRotation Text |
Instances
Eq InvalidRotation Source # | |
Defined in System.Wlog.LogHandler.Roller Methods (==) :: InvalidRotation -> InvalidRotation -> Bool # (/=) :: InvalidRotation -> InvalidRotation -> Bool # | |
Show InvalidRotation Source # | |
Defined in System.Wlog.LogHandler.Roller Methods showsPrec :: Int -> InvalidRotation -> ShowS # show :: InvalidRotation -> String # showList :: [InvalidRotation] -> ShowS # | |
Exception InvalidRotation Source # | |
Defined in System.Wlog.LogHandler.Roller Methods toException :: InvalidRotation -> SomeException # |
data RollerHandler Source #
Similar to GenericHandler
. But holds file Handle
inside
mutable variable (MVar
) to be able to rotate loggers.
Constructors
RollerHandler | |
Fields
|
Instances
LogHandler RollerHandler Source # | |
Defined in System.Wlog.LogHandler.Roller Methods getTag :: RollerHandler -> LogHandlerTag Source # setLevel :: RollerHandler -> Severities -> RollerHandler Source # getLevel :: RollerHandler -> Severities Source # setFormatter :: RollerHandler -> LogFormatter RollerHandler -> RollerHandler Source # getFormatter :: RollerHandler -> LogFormatter RollerHandler Source # emit :: MonadIO m => RollerHandler -> Builder -> Text -> m () Source # readBack :: MonadIO m => RollerHandler -> Int -> m [Text] Source # close :: MonadIO m => RollerHandler -> m () Source # |
rotationFileHandler :: MonadIO m => RotationParameters -> FilePath -> Severities -> m RollerHandler Source #
Create rotation logging handler.