iohk-monitoring-0.1.10.1: logging, benchmarking and monitoring framework
Safe HaskellNone
LanguageHaskell2010

Cardano.BM.Tracing

Synopsis

Documentation

newtype Tracer (m :: Type -> Type) a Source #

example: simply output a message on the console

let logTrace = traceWith $ showTracing $ stdoutTracer
in  logTrace "hello world"

example: calling a function and passing in a Tracer

example1 :: IO ()
example1 = do
    let logTrace a = traceWith (showTracing (contramap ("Debug: " ++) stdoutTracer)) a
    void $ callFun1 logTrace
callFun1 :: (String -> IO ()) -> IO Int
callFun1 logTrace = do
    logTrace "in function 1"
    return 42

runTracer evaluates a Tracer (i.e. consumes its argument)

Constructors

Tracer 

Fields

Instances

Instances details
Contravariant (Tracer m) 
Instance details

Defined in Control.Tracer

Methods

contramap :: (a -> b) -> Tracer m b -> Tracer m a #

(>$) :: b -> Tracer m b -> Tracer m a #

Applicative m => Divisible (Tracer m) Source # 
Instance details

Defined in Cardano.BM.Tracer

Methods

divide :: (a -> (b, c)) -> Tracer m b -> Tracer m c -> Tracer m a Source #

conquer :: Tracer m a Source #

Applicative m => Decidable (Tracer m) Source # 
Instance details

Defined in Cardano.BM.Tracer

Methods

lose :: (a -> Void) -> Tracer m a Source #

choose :: (a -> Either b c) -> Tracer m b -> Tracer m c -> Tracer m a Source #

Applicative m => Semigroup (Tracer m s) 
Instance details

Defined in Control.Tracer

Methods

(<>) :: Tracer m s -> Tracer m s -> Tracer m s #

sconcat :: NonEmpty (Tracer m s) -> Tracer m s #

stimes :: Integral b => b -> Tracer m s -> Tracer m s #

Applicative m => Monoid (Tracer m s) 
Instance details

Defined in Control.Tracer

Methods

mempty :: Tracer m s #

mappend :: Tracer m s -> Tracer m s -> Tracer m s #

mconcat :: [Tracer m s] -> Tracer m s #

data LogObject a Source #

Constructors

LogObject 

Instances

Instances details
Functor LogObject Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

Methods

fmap :: (a -> b) -> LogObject a -> LogObject b #

(<$) :: a -> LogObject b -> LogObject a #

Eq a => Eq (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

Methods

(==) :: LogObject a -> LogObject a -> Bool #

(/=) :: LogObject a -> LogObject a -> Bool #

Show a => Show (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

ToJSON a => ToJSON (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

FromJSON a => FromJSON (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

ToJSON a => ToObject (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Backend.Log

ToJSON a => LogItem (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Backend.Log

ToJSON a => ToObject (LogObject a) Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

data PrivacyAnnotation Source #

Constructors

Confidential 
Public 

Instances

Instances details
Bounded PrivacyAnnotation Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

Enum PrivacyAnnotation Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

Eq PrivacyAnnotation Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

Ord PrivacyAnnotation Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

Show PrivacyAnnotation Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

FromJSON PrivacyAnnotation Source # 
Instance details

Defined in Cardano.BM.Data.LogItem

data Severity Source #

Instances

Instances details
Bounded Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Enum Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Eq Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Ord Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Read Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Show Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Generic Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Associated Types

type Rep Severity :: Type -> Type #

Methods

from :: Severity -> Rep Severity x #

to :: Rep Severity x -> Severity #

Semigroup Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

Monoid Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

ToJSON Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

FromJSON Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

type Rep Severity Source # 
Instance details

Defined in Cardano.BM.Data.Severity

type Rep Severity = D1 ('MetaData "Severity" "Cardano.BM.Data.Severity" "iohk-monitoring-0.1.10.1-HMLUOmHf3Jc3X1FUafI45e" '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 => ToLogObject m where Source #

Minimal complete definition

toLogObject, toLogObject'

Methods

toLogObject :: (ToObject a, Transformable a m b) => Trace m a -> Tracer m b Source #

toLogObject' :: (ToObject a, Transformable a m b) => TracingVerbosity -> Trace m a -> Tracer m b Source #

toLogObjectVerbose :: (ToObject a, Transformable a m b) => Trace m a -> Tracer m b Source #

default toLogObjectVerbose :: (ToObject a, Transformable a m b) => Trace m a -> Tracer m b Source #

toLogObjectMinimal :: (ToObject a, Transformable a m b) => Trace m a -> Tracer m b Source #

default toLogObjectMinimal :: (ToObject a, Transformable a m b) => Trace m a -> Tracer m b Source #

class ToObject a where Source #

Minimal complete definition

Nothing

class (Monad m, HasPrivacyAnnotation b, HasSeverityAnnotation b) => Transformable a m b where Source #

Minimal complete definition

Nothing

Instances

Instances details
Transformable a IO Float Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable a IO Double Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable a IO Word64 Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable a IO Integer Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable a IO Int Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable String IO String Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable String IO Text Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable Text IO String Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

Transformable Text IO Text Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

(Monad m, Transformable t m a) => Transformable t m (WithPrivacyAnnotation a) Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

(Monad m, Transformable t m a) => Transformable t m (WithSeverity a) Source # 
Instance details

Defined in Cardano.BM.Data.Tracer

class HasPrivacyAnnotation a where Source #

Minimal complete definition

Nothing

class HasSeverityAnnotation a where Source #

Minimal complete definition

Nothing

contramap :: Contravariant f => (a -> b) -> f b -> f a #

nullTracer :: forall (m :: Type -> Type) a. Applicative m => Tracer m a Source #

this Tracer forgets about all arguments

traceWith :: Tracer m a -> a -> m () Source #

trace an observable value with a Tracer