Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- textLogStr :: LogStr -> Text
- newtype LogAction = LogAction {}
- defaultLogAction :: LogAction
- filterActionSeverity :: LogLevel -> LogAction -> LogAction
- newLogAction :: MonadUnliftIO m => (Loc -> LogSource -> LogLevel -> LogStr -> m ()) -> m LogAction
- runLogAction :: MonadIO m => LogAction -> Loc -> LogSource -> LogLevel -> LogStr -> m ()
- handleLogAction :: Handle -> LogAction
- openLoggingHandle :: MonadIO m => FilePath -> m Handle
- closeLoggingHandle :: MonadIO m => Handle -> m ()
- fileLogAction :: MonadUnliftIO m => FilePath -> (LogAction -> m a) -> m a
- class HasLogAction env where
- logActionL :: Lens' env LogAction
- type WithLogAction env m = (MonadIO m, MonadReader env m, HasLogAction env)
- askLogAction :: (MonadReader env m, HasLogAction env) => m LogAction
- newtype LogActionWrapperM env m a = LogActionM {
- unLogActionM :: m a
- newtype LogActionT m a = LogActionT {
- unLogActionT :: ReaderT LogAction m a
- runLogActionT :: LogActionT m a -> LogAction -> m a
- type LogActionM a = LogActionT IO a
- runLogActionM :: LogActionM a -> LogAction -> IO a
- class Monad m => MonadLogger (m :: Type -> Type) where
- monadLoggerLog :: ToLogStr msg => Loc -> LogSource -> LogLevel -> msg -> m ()
- data Loc = Loc {}
- type LogSource = Text
- data LogLevel
- data LogStr
- class ToLogStr msg where
- logDebugN :: MonadLogger m => Text -> m ()
- logInfoN :: MonadLogger m => Text -> m ()
- logWarnN :: MonadLogger m => Text -> m ()
- logErrorN :: MonadLogger m => Text -> m ()
- logOtherN :: MonadLogger m => LogLevel -> Text -> m ()
Documentation
textLogStr :: LogStr -> Text Source #
Instances
Monoid LogAction Source # | |
Semigroup LogAction Source # | |
HasLogAction LogAction Source # | |
Defined in LittleLogger | |
Monad m => MonadReader LogAction (LogActionT m) Source # | |
Defined in LittleLogger ask :: LogActionT m LogAction # local :: (LogAction -> LogAction) -> LogActionT m a -> LogActionT m a # reader :: (LogAction -> a) -> LogActionT m a # |
newLogAction :: MonadUnliftIO m => (Loc -> LogSource -> LogLevel -> LogStr -> m ()) -> m LogAction Source #
handleLogAction :: Handle -> LogAction Source #
closeLoggingHandle :: MonadIO m => Handle -> m () Source #
fileLogAction :: MonadUnliftIO m => FilePath -> (LogAction -> m a) -> m a Source #
class HasLogAction env where Source #
logActionL :: Lens' env LogAction Source #
Instances
HasLogAction LogAction Source # | |
Defined in LittleLogger |
type WithLogAction env m = (MonadIO m, MonadReader env m, HasLogAction env) Source #
askLogAction :: (MonadReader env m, HasLogAction env) => m LogAction Source #
newtype LogActionWrapperM env m a Source #
Use deriving-via with this wrapper to add MonadLogger instances to your types
LogActionM | |
|
Instances
newtype LogActionT m a Source #
LogActionT | |
|
Instances
runLogActionT :: LogActionT m a -> LogAction -> m a Source #
type LogActionM a = LogActionT IO a Source #
runLogActionM :: LogActionM a -> LogAction -> IO a Source #
class Monad m => MonadLogger (m :: Type -> Type) where #
A Monad
which has the ability to log messages in some manner.
Nothing
Instances
Loc | |
|
Instances
Data Loc | |
Defined in Language.Haskell.TH.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Loc -> c Loc # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Loc # dataTypeOf :: Loc -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Loc) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Loc) # gmapT :: (forall b. Data b => b -> b) -> Loc -> Loc # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Loc -> r # gmapQ :: (forall d. Data d => d -> u) -> Loc -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Loc -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Loc -> m Loc # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Loc -> m Loc # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Loc -> m Loc # | |
Generic Loc | |
Show Loc | |
Eq Loc | |
Ord Loc | |
type Rep Loc | |
Defined in Language.Haskell.TH.Syntax type Rep Loc = D1 ('MetaData "Loc" "Language.Haskell.TH.Syntax" "template-haskell" 'False) (C1 ('MetaCons "Loc" 'PrefixI 'True) ((S1 ('MetaSel ('Just "loc_filename") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "loc_package") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just "loc_module") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "loc_start") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CharPos) :*: S1 ('MetaSel ('Just "loc_end") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CharPos))))) |
Log message builder. Use (<>
) to append two LogStr in O(1).
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.
Instances
logDebugN :: MonadLogger m => Text -> m () #
logInfoN :: MonadLogger m => Text -> m () #
logWarnN :: MonadLogger m => Text -> m () #
logErrorN :: MonadLogger m => Text -> m () #
logOtherN :: MonadLogger m => LogLevel -> Text -> m () #