Skip to content

Instantly share code, notes, and snippets.

@mhulse
Created October 2, 2014 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhulse/ca160e094c99fad75004 to your computer and use it in GitHub Desktop.
Save mhulse/ca160e094c99fad75004 to your computer and use it in GitHub Desktop.
Caché 2009.1 - NEWSCYCLE Solutions: DTI Lighting 7.7.x: Display useful debug information.
<csp:if condition='$data(%request.Data("meta", 1))'>
<hr>
<div class="wiffle">
<section>
<h1 class="head">Meta!</h1>
<csp:if condition=($isobject($get(gStory)))>
<h2><code>gStory</code></h2>
<pre>#[ do $system.OBJ.Dump(gStory) ]#</pre>
<h2><code>gStory.getStory()</code></h2>
<pre>#[ do $system.OBJ.Dump(gStory.getStory()) ]#</pre>
</csp:if>
<csp:if condition=($isobject($get(gSection)))>
<h2><code>gSection</code></h2>
<pre>#[ do $system.OBJ.Dump(gSection) ]#</pre>
</csp:if>
<h2><code>%request</code></h2>
<pre>#[ do $system.OBJ.Dump(%request) ]#</pre>
<h2><code>zwrite</code></h2>
<script language="cache" runat="server">
write !, "<pre>"
try {
set currIO = ##class(%SYS.NLS.Device).SetIO("HTML")
zwrite
}
catch {
write "ERROR: ", $ZERROR
}
if ($get(currIO) '= "") {
do ##class(%SYS.NLS.Device).SetIO(currIO)
}
write "</pre>"
</script>
</section>
</div> <!-- /.wiffle -->
</csp:if>
@mhulse
Copy link
Author

mhulse commented Oct 2, 2014

We include the above at the bottom of our globally used Section template, like so:

<dti:file:include base="assets" file="/includes/meta.csp" />

If used, you'll probably want to change up the HTML tags wrapping the COS output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment