Skip to content

Commit

Permalink
Add tests for stdoutANSITransport
Browse files Browse the repository at this point in the history
  • Loading branch information
ccycle committed Aug 15, 2022
1 parent 738f8b0 commit 359691c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tests/stdout.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import Herp.Logger as Logger
import Herp.Logger.StdoutTransport
import System.Log.FastLogger.LoggerSet as LS

loggerLevelTest loggerSet lv = do
logger <- Logger.new 1 lv [stdoutTransport loggerSet Debug]
loggerLevelTest loggerSet transports lv = do
logger <- Logger.new 1 lv transports

flip runReaderT logger $ do
logM [ #debug, "debug" ]
Expand All @@ -23,10 +23,12 @@ loggerLevelTest loggerSet lv = do
logM [ #crit, "lorem ipsum" ]
logM [ #alert, "lorem ipsum" ]
logM [ #emerg, "lorem ipsum" ]

loggerCleanup logger

main :: IO ()
main = bracket (LS.newStdoutLoggerSet 4096) LS.rmLoggerSet $ \loggerSet -> do
loggerLevelTest loggerSet Debug
loggerLevelTest loggerSet Informational
loggerLevelTest loggerSet [stdoutTransport loggerSet Debug] Debug
loggerLevelTest loggerSet [stdoutTransport loggerSet Debug] Informational
loggerLevelTest loggerSet [stdoutANSITransport loggerSet Debug] Debug
loggerLevelTest loggerSet [stdoutANSITransport loggerSet Debug] Informational

0 comments on commit 359691c

Please sign in to comment.