ganeti-3.1: Cluster-based virtualization management software
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ganeti.Logging

Description

Implementation of the Ganeti logging functionality.

This currently lacks the following (FIXME):

  • log file reopening

Note that this requires the hslogger library version 1.1 and above.

Synopsis

Documentation

setupLogging #

Arguments

:: Maybe String

Log file

-> String

Program name

-> Bool

Debug level

-> Bool

Log to stderr

-> Bool

Log to console

-> SyslogUsage

Syslog usage

-> IO () 

Sets up the logging configuration.

class Monad m => MonadLog m where #

A monad that allows logging.

Methods

logAt :: Priority -> String -> m () #

Log at a given level.

Instances

Instances details
MonadLog MetadMonadInt # 
Instance details

Defined in Ganeti.Metad.ConfigCore

Methods

logAt :: Priority -> String -> MetadMonadInt () #

MonadLog WConfdMonadInt # 
Instance details

Defined in Ganeti.WConfd.Monad

Methods

logAt :: Priority -> String -> WConfdMonadInt () #

MonadLog IO # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> IO () #

Monad m => MonadLog (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

logAt :: Priority -> String -> WriterLogT m () #

MonadLog m => MonadLog (MaybeT m) # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> MaybeT m () #

(MonadLog m, Error e) => MonadLog (ResultT e m) # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> ResultT e m () #

MonadLog m => MonadLog (IdentityT m) # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> IdentityT m () #

MonadLog m => MonadLog (ReaderT r m) # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> ReaderT r m () #

MonadLog m => MonadLog (StateT s m) # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> StateT s m () #

(MonadLog m, Monoid w) => MonadLog (RWST r w s m) # 
Instance details

Defined in Ganeti.Logging

Methods

logAt :: Priority -> String -> RWST r w s m () #

data Priority #

Instances

Instances details
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

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

toConstr :: Priority -> Constr

dataTypeOf :: Priority -> DataType

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

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

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

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

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

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

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

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

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

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

Bounded Priority 
Instance details

Defined in System.Log

Enum Priority 
Instance details

Defined in System.Log

Generic Priority 
Instance details

Defined in System.Log

Associated Types

type Rep Priority :: Type -> Type

Methods

from :: Priority -> Rep Priority x

to :: Rep Priority x -> Priority

Read Priority 
Instance details

Defined in System.Log

Methods

readsPrec :: Int -> ReadS Priority

readList :: ReadS [Priority]

readPrec :: ReadPrec Priority

readListPrec :: ReadPrec [Priority]

Show Priority 
Instance details

Defined in System.Log

Methods

showsPrec :: Int -> Priority -> ShowS

show :: Priority -> String

showList :: [Priority] -> ShowS

NFData Priority 
Instance details

Defined in System.Log

Methods

rnf :: Priority -> ()

Eq Priority 
Instance details

Defined in System.Log

Methods

(==) :: Priority -> Priority -> Bool

(/=) :: Priority -> Priority -> Bool

Ord Priority 
Instance details

Defined in System.Log

Methods

compare :: Priority -> Priority -> Ordering

(<) :: Priority -> Priority -> Bool

(<=) :: Priority -> Priority -> Bool

(>) :: Priority -> Priority -> Bool

(>=) :: Priority -> Priority -> Bool

max :: Priority -> Priority -> Priority

min :: Priority -> Priority -> Priority

type Rep Priority 
Instance details

Defined in System.Log

type Rep Priority = D1 ('MetaData "Priority" "System.Log" "hslogger-1.3.1.1-ImoCTOrsk2lITSqD9Ph1GO" '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))))

logDebug :: MonadLog m => String -> m () #

Log at debug level.

logInfo :: MonadLog m => String -> m () #

Log at info level.

logNotice :: MonadLog m => String -> m () #

Log at notice level.

logWarning :: MonadLog m => String -> m () #

Log at warning level.

logError :: MonadLog m => String -> m () #

Log at error level.

logCritical :: MonadLog m => String -> m () #

Log at critical level.

logAlert :: MonadLog m => String -> m () #

Log at alert level.

logEmergency :: MonadLog m => String -> m () #

Log at emergency level.

data SyslogUsage #

Syslog usage type.

Constructors

SyslogNo 
SyslogYes 
SyslogOnly 

Instances

Instances details
Bounded SyslogUsage # 
Instance details

Defined in Ganeti.Logging

Enum SyslogUsage # 
Instance details

Defined in Ganeti.Logging

Show SyslogUsage # 
Instance details

Defined in Ganeti.Logging

Methods

showsPrec :: Int -> SyslogUsage -> ShowS

show :: SyslogUsage -> String

showList :: [SyslogUsage] -> ShowS

Eq SyslogUsage # 
Instance details

Defined in Ganeti.Logging

Methods

(==) :: SyslogUsage -> SyslogUsage -> Bool

(/=) :: SyslogUsage -> SyslogUsage -> Bool

Ord SyslogUsage # 
Instance details

Defined in Ganeti.Logging

syslogUsageFromRaw :: forall m. (Monad m, MonadFail m) => String -> m SyslogUsage #

withErrorLogAt :: (MonadLog m, MonadError e m, Show e) => Priority -> String -> m a -> m a #

If an error occurs within a given computation, it annotated with a given message and logged and the error is re-thrown.

isDebugMode :: IO Bool #

Check if the logging is at DEBUG level. DEBUG logging is unacceptable for production.