[web-devel] adding debug output to a response

Mark Bradley barkmadley at gmail.com
Mon Nov 29 03:49:03 CET 2010

It depends where you want the output to go.

You can definitely add an area to your template which you can list
error / debug messages.

Alternatively you can do a `liftIO $ print x` from the handler
function to print some output to the console (you can also liftIO
other operations such as file io so you can append to a log file).

there is also the onRequest function in the Yesod typeclass which gets
run once per request where you can do some logging/output.

sent from an internet enabled device

2010/11/29 Simon Michael <simon at joyful.com>:
> This might be slightly related.. in PHP code I sometimes dump something into the output stream "right now". This can be
> quite handy for debugging, you can tell things from the position on the page etc. Can this be done from a yesod request
> handler ?
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel

More information about the web-devel mailing list