Calendar

««Jan 2012»»
SMTWTFS
1234567
891011121314
15161718192021
22232425262728
293031

Alert Email

Get a short email alert whenever a new entry is published.

Confidential, secure it's piece of cake to keep uptodate.

Get a little debugging help from OpenBD

Published: 10:08 AM GMT, Tuesday, 24 August 2010

Debugging CFML applications just got a little easier from OpenBD with the introduction of the Console() function. This is a function that will print out any input given to the main console of the running server.

<cfset ConsoleOutput(true)>
<cfset Console(cgi)>

will produce this output in the console that you run up OpenBD from:

+----------------------+--
|            HTTP_HOST | 127.0.0.1
|      HTTP_USER_AGENT | Mozilla/5.0
|          HTTP_ACCEPT | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
| HTTP_ACCEPT_LANGUAGE | en-us,en;q=0.5
| HTTP_ACCEPT_ENCODING | gzip, deflate
|  HTTP_ACCEPT_CHARSET | ISO-8859-1,utf-8;q=0.7,*;q=0.7
|      HTTP_KEEP_ALIVE | 115
|      HTTP_CONNECTION | keep-alive
|         HTTP_REFERER | http://127.0.0.1/dashboard/?p_id=20031
|          HTTP_COOKIE | CFID=0; CFTOKEN=6B8E49D3-E6FC-4A0C-A7A38ADCC540FECA;
|      SERVER_SOFTWARE | jetty/6.1.15.rc5
|          SERVER_NAME | 127.0.0.1
|    GATEWAY_INTERFACE |
|      SERVER_PROTOCOL | HTTP/1.1
|          SERVER_PORT | 80
|   SERVER_PORT_SECURE | 0
|       REQUEST_METHOD | GET
|            PATH_INFO |
|      PATH_TRANSLATED | E:\_openbd_\index.cfm
|          SCRIPT_NAME | /index.cfm
|         QUERY_STRING |
|          REMOTE_HOST | 127.0.0.1
|          REMOTE_ADDR | 127.0.0.1
|            AUTH_TYPE |
|            AUTH_USER |
|          REMOTE_USER |
|         REMOTE_IDENT |
|         CONTENT_TYPE |
|       CONTENT_LENGTH | -1
|         CONTEXT_PATH |
|                HTTPS | off
|     CF_TEMPLATE_PATH | E:\_openbd_\index.cfm
+----------------------+--

Designed specifically for developers who are developing code on the same machine they run up the OpenBD server, you can use the console as a constant scrolling output display to simply drop variables into.

Query, Struct, and Array objects are all formatted specifically for the character console, allowing you to quickly see what is what.

The Console() function has been designed to be safely left in to production code. You can turn it on or off globally by calling the ConsoleOutput( true|false ). By default, the output is disabled.

CFML developers can think of this function as the CFML version of the Java "System.out.println()" for quickly throwing output to the console so you can see whats-what without interfering with the output of the HTML request.

Available in the 1.4a nightly build now.

Comments (0)

Add Comment