| 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.
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
...
Note: If there is an unhandled Exception in your application, it will be
logged into the root Sink, and then rethrown.
module Logging.Global.TH