snap-core- Snap: A Haskell Web Framework (core interfaces and types)

Safe HaskellSafe



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.



debug :: MonadIO m => String -> m () Source #

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


ghci> debug "Some debug message"
[     225] Some debug message

debugErrno :: MonadIO m => String -> m () Source #

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).


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