HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulesnap-core-1.0.5.1Haskell2010

Snap.Internal.Debug

An internal Snap module for (optionally) printing debugging messages. To enable debug output, compile the library with the debug flag (off by default) and set the environment variable DEBUG to 1. We use unsafePerformIO to make sure that the call to getEnv is only made once.

N.B. this is an internal interface, please don't write external code that depends on it.

  • 2 values
valuedebug :: MonadIO m => String -> m ()
#

Print out the provided debug message prefixed by the thread ID.

Example:

ghci> debug "Some debug message"
[     225] Some debug message
valuedebugErrno :: MonadIO m => String -> m ()
#

Print out the error message corresponding to the Errno value returned by getErrno together with any additional information provided by the user (usually the location where the error occurred).

Example:

ghci> debugErrno "pathtoSource.hs:34"
[     323] pathtoSource.hs:34: failed (Success)