packages feed

hslogger-template 0.2 → 0.2.1

raw patch · 2 files changed

+18/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hslogger-template.cabal view
@@ -1,5 +1,5 @@ name:     hslogger-template-version:  0.2+version:  0.2.1 synopsis: Automatic generation of hslogger functions description:     Library for generating hslogger functions using Template Haskell.@@ -12,6 +12,8 @@  cabal-version: >= 1.6 build-type:    Custom++extra-source-files: src/test.hs  library   exposed-modules: System.Log.Logger.TH
+ src/test.hs view
@@ -0,0 +1,15 @@+module Main (main) where++import System.Log.Logger.TH (deriveLoggers)+import qualified System.Log.Logger as HSL++$(deriveLoggers "HSL" [HSL.DEBUG, HSL.INFO, HSL.NOTICE, HSL.WARNING, HSL.ERROR, HSL.CRITICAL, HSL.ALERT, HSL.EMERGENCY])++main :: IO ()+main = do+    HSL.updateGlobalLogger "Main" (HSL.setLevel HSL.DEBUG)+    mapM_ (\(f, fn, i) -> f (show i ++ " " ++ fn)) (zip3 functions functionNames numbers)+  where+    functions     = [debugM, infoM, noticeM, warningM, errorM, criticalM, alertM, emergencyM]+    functionNames = ["debugM", "infoM", "noticeM", "warningM", "errorM", "criticalM", "alertM", "emergencyM"]+    numbers       = [1..] :: [Integer]