mockery-0.3.5: Support functions for automated testing

Safe Haskell | None
Language | Haskell2010

Test.Mockery.Logging

Synopsis

- captureLogMessages :: IO a -> IO ([(LogLevel, String)], a)
- captureLogMessages_ :: IO a -> IO [(LogLevel, String)]
- data LogLevel :: *
  - = TRACE
  - | DEBUG
  - | INFO
  - | WARN
  - | ERROR

# Documentation

captureLogMessages :: IO a -> IO ([(LogLevel, String)], a) Source #

Capture all log messages produced by an IO action. Logs are kept in memory.

captureLogMessages_ :: IO a -> IO [(LogLevel, String)] Source #

Like `captureLogsMessages`, but ignores the result.

data LogLevel :: * #

Constructors

TRACE |
DEBUG |
INFO |
WARN |
ERROR |

Instances

Bounded LogLevel |
Methods minBound :: LogLevel # maxBound :: LogLevel #
Enum LogLevel |
Methods succ :: LogLevel -> LogLevel # pred :: LogLevel -> LogLevel # toEnum :: Int -> LogLevel # fromEnum :: LogLevel -> Int # enumFrom :: LogLevel -> [LogLevel] # enumFromThen :: LogLevel -> LogLevel -> [LogLevel] # enumFromTo :: LogLevel -> LogLevel -> [LogLevel] # enumFromThenTo :: LogLevel -> LogLevel -> LogLevel -> [LogLevel] #
Eq LogLevel |
Methods (==) :: LogLevel -> LogLevel -> Bool # (/=) :: LogLevel -> LogLevel -> Bool #
Ord LogLevel |
Methods compare :: LogLevel -> LogLevel -> Ordering # (<) :: LogLevel -> LogLevel -> Bool # (<=) :: LogLevel -> LogLevel -> Bool # (>) :: LogLevel -> LogLevel -> Bool # (>=) :: LogLevel -> LogLevel -> Bool # max :: LogLevel -> LogLevel -> LogLevel # min :: LogLevel -> LogLevel -> LogLevel #
Read LogLevel |
Methods readsPrec :: Int -> ReadS LogLevel # readList :: ReadS [LogLevel] # readPrec :: ReadPrec LogLevel # readListPrec :: ReadPrec [LogLevel] #
Show LogLevel |
Methods showsPrec :: Int -> LogLevel -> ShowS # show :: LogLevel -> String # showList :: [LogLevel] -> ShowS #