lambdabot-core-5.3.1.2: Lambdabot core functionality

Safe Haskell | None
Language | Haskell98

Lambdabot.Logging

Synopsis

- data Priority
  - = DEBUG
  - | INFO
  - | NOTICE
  - | WARNING
  - | ERROR
  - | CRITICAL
  - | ALERT
  - | EMERGENCY
- class Monad m => MonadLogging (m :: Type -> Type) where
  - getCurrentLogger :: m [String]
  - logM :: String -> Priority -> String -> m ()
- debugM :: MonadLogging m => String -> m ()
- infoM :: MonadLogging m => String -> m ()
- noticeM :: MonadLogging m => String -> m ()
- warningM :: MonadLogging m => String -> m ()
- errorM :: MonadLogging m => String -> m ()
- criticalM :: MonadLogging m => String -> m ()
- alertM :: MonadLogging m => String -> m ()
- emergencyM :: MonadLogging m => String -> m ()

# Documentation

data Priority Source #

Priorities are used to define how important a log message is. Users can filter log messages based on priorities.

These have their roots on the traditional syslog system. The standard definitions are given below, but you are free to interpret them however you like. They are listed here in ascending importance order.

Constructors

DEBUG | Debug messages
INFO | Information
NOTICE | Normal runtime conditions
WARNING | General Warnings
ERROR | General Errors
CRITICAL | Severe situations
ALERT | Take immediate action
EMERGENCY | System is unusable

#### Instances

Instances details

NFData Priority | Since: hslogger-1.3.1.0
Instance details Defined in System.Log Methods rnf :: Priority -> () Source #
Data Priority |

Instance details

Defined in System.Log

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Priority -> c Priority Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Priority Source #

toConstr :: Priority -> Constr Source #

dataTypeOf :: Priority -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Priority) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Priority) Source #

gmapT :: (forall b. Data b => b -> b) -> Priority -> Priority Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Priority -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Priority -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Priority -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Priority -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Priority -> m Priority Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Priority -> m Priority Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Priority -> m Priority Source #

Bounded Priority |
Instance details Defined in System.Log Methods minBound :: Priority Source # maxBound :: Priority Source #
Enum Priority |

Instance details

Defined in System.Log

Methods

succ :: Priority -> Priority Source #

pred :: Priority -> Priority Source #

toEnum :: Int -> Priority Source #

fromEnum :: Priority -> Int Source #

enumFrom :: Priority -> [Priority] Source #

enumFromThen :: Priority -> Priority -> [Priority] Source #

enumFromTo :: Priority -> Priority -> [Priority] Source #

enumFromThenTo :: Priority -> Priority -> Priority -> [Priority] Source #

Generic Priority |

Instance details

Defined in System.Log

Associated Types

type Rep Priority |

Instance details

Defined in System.Log

type Rep Priority = D1 ('MetaData "Priority" "System.Log" "hslogger-1.3.2.0-7InjwZUz8RN2lItqNTj9Ba" 'False) (((C1 ('MetaCons "DEBUG" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "INFO" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "NOTICE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WARNING" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ERROR" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CRITICAL" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ALERT" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EMERGENCY" 'PrefixI 'False) (U1 :: Type -> Type))))

Methods

from :: Priority -> Rep Priority x Source #

to :: Rep Priority x -> Priority Source #

Read Priority |
Instance details Defined in System.Log Methods readsPrec :: Int -> ReadS Priority Source # readList :: ReadS [Priority] Source # readPrec :: ReadPrec Priority Source # readListPrec :: ReadPrec [Priority] Source #
Show Priority |
Instance details Defined in System.Log Methods showsPrec :: Int -> Priority -> ShowS Source # show :: Priority -> String Source # showList :: [Priority] -> ShowS Source #
Eq Priority |
Instance details Defined in System.Log Methods (==) :: Priority -> Priority -> Bool Source # (/=) :: Priority -> Priority -> Bool Source #
Ord Priority |
Instance details Defined in System.Log Methods compare :: Priority -> Priority -> Ordering Source # (<) :: Priority -> Priority -> Bool Source # (<=) :: Priority -> Priority -> Bool Source # (>) :: Priority -> Priority -> Bool Source # (>=) :: Priority -> Priority -> Bool Source # max :: Priority -> Priority -> Priority Source # min :: Priority -> Priority -> Priority Source #
type Rep Priority |

Instance details

Defined in System.Log

type Rep Priority = D1 ('MetaData "Priority" "System.Log" "hslogger-1.3.2.0-7InjwZUz8RN2lItqNTj9Ba" 'False) (((C1 ('MetaCons "DEBUG" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "INFO" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "NOTICE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WARNING" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "ERROR" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "CRITICAL" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "ALERT" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EMERGENCY" 'PrefixI 'False) (U1 :: Type -> Type))))

class Monad m => MonadLogging (m :: Type -> Type) where Source #

Methods

getCurrentLogger :: m [String] Source #

logM :: String -> Priority -> String -> m () Source #

#### Instances

Instances details

MonadLogging IO Source # |
Instance details Defined in Lambdabot.Logging Methods getCurrentLogger :: IO [String] Source # logM :: String -> Priority -> String -> IO () Source #
MonadLogging LB Source # |
Instance details Defined in Lambdabot.Monad Methods getCurrentLogger :: LB [String] Source # logM :: String -> Priority -> String -> LB () Source #
MonadLogging m => MonadLogging (Cmd m) Source # |
Instance details Defined in Lambdabot.Command Methods getCurrentLogger :: Cmd m [String] Source # logM :: String -> Priority -> String -> Cmd m () Source #
MonadLogging m => MonadLogging (ModuleT st m) Source # |
Instance details Defined in Lambdabot.Module Methods getCurrentLogger :: ModuleT st m [String] Source # logM :: String -> Priority -> String -> ModuleT st m () Source #

debugM :: MonadLogging m => String -> m () Source #

infoM :: MonadLogging m => String -> m () Source #

noticeM :: MonadLogging m => String -> m () Source #

warningM :: MonadLogging m => String -> m () Source #

errorM :: MonadLogging m => String -> m () Source #

criticalM :: MonadLogging m => String -> m () Source #

alertM :: MonadLogging m => String -> m () Source #

emergencyM :: MonadLogging m => String -> m () Source #