| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Class.MonadEventlog
Synopsis
- class Monad m => MonadEventlog (m :: Type -> Type) where
- traceEventIO :: String -> m ()
- traceMarkerIO :: String -> m ()
- flushEventLog :: m ()
- traceEvent :: String -> a -> a
- traceMarker :: String -> a -> a
Documentation
class Monad m => MonadEventlog (m :: Type -> Type) where Source #
Methods
traceEventIO :: String -> m () Source #
Emits a message to the eventlog, if eventlog profiling is available and enabled at runtime.
traceMarkerIO :: String -> m () Source #
Emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime.
The String is the name of the marker. The name is just used in the
profiling tools to help you keep clear which marker is which.
flushEventLog :: m () Source #
Immediately flush the event log, if enabled.
Instances
| MonadEventlog IO Source # | |
Defined in Control.Monad.Class.MonadEventlog Methods traceEventIO :: String -> IO () Source # traceMarkerIO :: String -> IO () Source # flushEventLog :: IO () Source # | |
| MonadEventlog m => MonadEventlog (ReaderT r m) Source # | |
Defined in Control.Monad.Class.MonadEventlog Methods traceEventIO :: String -> ReaderT r m () Source # traceMarkerIO :: String -> ReaderT r m () Source # flushEventLog :: ReaderT r m () Source # | |
traceEvent :: String -> a -> a #
The traceEvent function behaves like trace with the difference that
the message is emitted to the eventlog, if eventlog profiling is available
and enabled at runtime.
It is suitable for use in pure code. In an IO context use traceEventIO
instead.
Note that when using GHC's SMP runtime, it is possible (but rare) to get
duplicate events emitted if two CPUs simultaneously evaluate the same thunk
that uses traceEvent.
Since: base-4.5.0.0
traceMarker :: String -> a -> a #
The traceMarker function emits a marker to the eventlog, if eventlog
profiling is available and enabled at runtime. The String is the name of
the marker. The name is just used in the profiling tools to help you keep
clear which marker is which.
This function is suitable for use in pure code. In an IO context use
traceMarkerIO instead.
Note that when using GHC's SMP runtime, it is possible (but rare) to get
duplicate events emitted if two CPUs simultaneously evaluate the same thunk
that uses traceMarker.
Since: base-4.7.0.0