Skip to content

bsl/hslogger-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hslogger-template generates hslogger functions using Template Haskell. The generated functions specify the name of the current module, so you don't have to.

Example:

module Foo.Bar ( ... ) where

import System.Log.Logger.TH (deriveLoggers)
import qualified System.Log.Logger as HSL

$(deriveLoggers "HSL" [HSL.DEBUG, HSL.INFO])

Used this way, deriveLoggers would generate the following functions:

infoM :: MonadIO m => String -> m ()
infoM s = liftIO (HSL.infoM "Foo.Bar" s)

debugM :: MonadIO m => String -> m ()
debugM s = liftIO (HSL.debugM "Foo.Bar" s)

The other hslogger priorities follow the same pattern.

About

Library for generating hslogger functions using Template Haskell.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •