log4hs-0.5.0.0: src/Logging.hs
{-|
Module : Logging
Copyright : (c) 2019 Version Cloud
License : BSD3
Maintainer : Jorah Gao <log4hs@version.cloud>
Stability : experimental
Portability : portable
= A python logging style log library.
=== A simple example:
@
\{\-\# LANGUAGE OverloadedStrings \#\-\}
\{\-\# LANGUAGE TemplateHaskell \#\-\}
module Main ( main ) where
import Logging (run)
import Logging.Config.Json (getManager)
import Logging.TH (debug, error, fatal, info, logv, warn)
import Prelude hiding (error)
main :: IO ()
main = getManager "{}" >>= flip run app
myLogger = \"MyLogger.Main\"
app :: IO ()
app = do
$(debug) myLogger \"this is a test message\"
$(info) myLogger \"this is a test message\"
$(warn) myLogger \"this is a test message\"
$(error) myLogger \"this is a test message\"
$(fatal) myLogger \"this is a test message\"
$(logv) myLogger \"LEVEL 100\" \"this is a test message\"
@
See "Logging.Config.Json" and "Logging.Config.Yaml" to lean more about
decoding 'Manager' from json or yaml
-}
module Logging
( module Logging.Types
, module Logging.TH
, module Logging.Internal
) where
import Logging.Internal hiding (log)
import Logging.TH
import Logging.Types