[web-devel] Re: adding debug output to a response

Matt Brown matt at softmechanics.net
Mon Nov 29 18:24:26 CET 2010


Once in the GWidget monad, you can use "addHtml . string":

defaultLayout $ do
  -- stuff
  addHtml $ string "did stuff"
  -- more stuff

Alternatively, you could use hamlet to put your messages into divs, so
you show/hide all messages with javascript or firebug:

trace :: String -> GWidget sub y ()
trace msg = addHamlet [$hamlet| %div!class=trace $msg$ |]

Does that help?

-matt

On Mon, Nov 29, 2010 at 7:56 AM, Simon Michael <simon at joyful.com> wrote:
> Thanks, I did not know about onRequest.
>
> I want to send debug output immediately to the response, so that it appears
> on the rendered web page intermixed with the regular content. Ie I'm
> wondering is if there's an equivalent of trace for the web output.
>
> _______________________________________________
> 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