Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Small logging library. Typical usage, import qualified:
import qualified Unison.Util.Logger as L
do logger <- L.atomic . L.atInfo . L.scope "worker" . L.toHandle $ stderr L.warn logger "WARNING!!!" L.debug logger "Debug message, will be ignored" let logger2 = L.atDebug logger L.debug logger2 "Debug message, will be printed" logger' <- L.at L.warnLevel
Synopsis
- type Level = Int
- type Scope = [String]
- data Logger = Logger {}
- atomic :: Logger -> IO Logger
- toHandle :: Handle -> Logger
- toStandardError :: Logger
- toStandardOut :: Logger
- logHandleAt :: Logger -> Level -> Handle -> IO ()
- logAt' :: Logger -> Level -> IO String -> IO ()
- logAt :: Logger -> Level -> String -> IO ()
- scope :: String -> Logger -> Logger
- scope' :: [String] -> Logger -> Logger
- logger :: (String -> IO ()) -> Logger
- error :: Logger -> String -> IO ()
- warn :: Logger -> String -> IO ()
- info :: Logger -> String -> IO ()
- debug :: Logger -> String -> IO ()
- trace :: Logger -> String -> IO ()
- error' :: Logger -> IO String -> IO ()
- warn' :: Logger -> IO String -> IO ()
- info' :: Logger -> IO String -> IO ()
- debug' :: Logger -> IO String -> IO ()
- trace' :: Logger -> IO String -> IO ()
- errorLevel :: Level
- warnLevel :: Level
- infoLevel :: Level
- debugLevel :: Level
- traceLevel :: Level
- at :: Level -> Logger -> Logger
- atError :: Logger -> Logger
- atWarn :: Logger -> Logger
- atInfo :: Logger -> Logger
- atDebug :: Logger -> Logger
- atTrace :: Logger -> Logger
- increment :: Logger -> Logger
- decrement :: Logger -> Logger