úÎ!41˜(      !"#$%&'None0T'di Obtain a ( that will write logs in the df1 format to .!Generally, you will want to call '- just once per application, right from your main function. For example: main :: )' () main = do -- First you obtain a (-. -- You do this once per application, in main. 'X $ \di -> do -- You can start logging right away by acting -- on the on the (. object, but here -- we encourage using %8 and perforfing -- all your logging from within a !. %7 di $ do -- Our first log message! 3 "Welcome to my program!" -- You can use pushN to separate different -- logging scopes of your program: % "initialization" $ do % "Starting web server" A "Disk is almost full" -- Yet another scope. , "server" $ do -- You can use ^ to add metadata to -- messages logged within a particular scope. , "port" (80 :: Int) $ do Å "Listening for new clients" clientAddress <- do -- This is just an example. Whatever. pure ("10.0.0.8" :: String) & "handler" $ do > "client-address" clientAddress $ do ÿÿ "Connection established" -- If you throw an exception with throw, -- it will be logged automatically together -- with its current scope. Isn't that nice? # (userError "Oops!") 0That program will render something like this to : @https://raw.githubusercontent.com/k0001/di/df1-0.3.2/df1/df1.png df1 examplesYou get the nice colors only if the output is going to a TTY. Otherwise, you get the same, but without any colors. ÿõ2019-11-15T18:05:54.949470902Z NOTICE Welcome to my program! 2019-11-15T18:05:54.949623731Z /initialization NOTICE Starting web server 2019-11-15T18:05:54.949630205Z /initialization ALERT Disk is almost full 2019-11-15T18:05:54.949640299Z /server port=80 INFO Listening for new clients 2019-11-15T18:05:54.949652133Z /server port=80 /handler client-address=10.0.0.8 INFO Connection established 2019-11-15T18:05:54.949664482Z /server port=80 /handler client-address=10.0.0.8 WARNING user error (Oops!) Notice that by default, all exceptions thrown using # are logged at their throw site with */ level. You can change that if you care using +. Unrelated: df19 escapes conflicting punctuation characters as necessary.'diThis type is the same as " -> m a.,Within this scope, you can use the obtained (( safely, even concurrently. As soon as m a finishes, 'G will block until all logs have finished processing, before returning.WARNING: Even while ' commit , :: m ((    )- type-checks, attempting to use the obtained (' outside its intended scope will fail.di(  & !"#$%'('#%$&" !   -      !"#$%&'()*+,-.,-/,-0,-12345678,-9:;<=di-1.2.2-FonFICXF8yRAxu3eRksheBDi System.IOstderr df1-0.3.2-KDPqdx7lxyTLa9a0QWxvMl Df1.TypesMessagemessage ToMessageLevelSegmentsegment ToSegmentKeykeyToKeyValuevalueToValuePath!di-df1-1.1-DyL0UUSkjsW1pWZGAECiDI Di.Df1.Monaddebug'info'notice'warning'error'alert' critical' emergency'debuginfonoticewarningerrorcriticalalert emergencyattrpushDf1TMonadDf1Di.Df1Df1%di-monad-1.3.1-HmIPZyKPRYXI7III9AbYo2Di.MonadthrowhoistDiTrunDiTasknew$di-core-1.0.4-GcSN3LXRDBd7KPkoGfm3SsDi.Coreghc-prim GHC.TypesIOWarning onExceptionbaseGHC.Basepure