Safe Haskell | None |
---|---|
Language | GHC2021 |
Provides functionality for logging to a specific region (i.e. for concurrent console logging).
Synopsis
- class Monad m => MonadRegionLogger (m :: Type -> Type) where
- type Region (m :: Type -> Type)
- logGlobal :: Text -> m ()
- logRegion :: LogMode -> Region m -> Text -> m ()
- withRegion :: HasCallStack => RegionLayout -> (Region m -> m a) -> m a
- displayRegions :: HasCallStack => m a -> m a
Documentation
class Monad m => MonadRegionLogger (m :: Type -> Type) where Source #
MonadRegionLogger
is a simple typeclass for abstracting logging functions.
type Region (m :: Type -> Type) Source #
The type of the region. This will be ConsoleRegion for production code and () for tests.
logGlobal :: Text -> m () Source #
Pushes a log to the "global" region.
logRegion :: LogMode -> Region m -> Text -> m () Source #
Pushes a log to the region.
withRegion :: HasCallStack => RegionLayout -> (Region m -> m a) -> m a Source #
Runs an m a
with a region.
displayRegions :: HasCallStack => m a -> m a Source #
Displays the regions. This should wrap whatever top-level logic needs regions.