| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Logging.Global
Description
Run logging globally.
The run function will properly "initialize" and "terminate" the
global Manager.
If the Manager's catchUncaughtException is True, the run function will
set an uncaught exception handler that will log all uncaught exceptions,
and set the handler to the original one before run is complete.
Synopsis
- run :: Manager -> IO a -> IO a
- module Logging.Global.TH
Documentation
run :: Manager -> IO a -> IO a Source #
Run the global logging environment.
You should always run you application in the global logging environment.
main :: IO ()
main = run manager app
app :: IO ()
app = do
$(info) "App" "..."
...
Never run multiple global logging environments concurrently.
-- bad useage
main :: IO ()
main = do
forkIO $ run manager1 app1
forkIO $ run manager2 app2
...
-- correct useage
main :: IO ()
main = run manager $ do
forkIO app1
forkIO app2
...
module Logging.Global.TH