Using cfdump withh output="console"

1,102 views
Skip to first unread message

Legentigger

unread,
Mar 24, 2013, 7:30:42 PM3/24/13
to ra...@googlegroups.com
I like to debug my applications using the <cfdump var="#somevar#" output="console">.

If I run railo in a terminal with
./catalina.sh run

I can see my cfdump output.

However each simple (string) cfdump output is put right next to the previous output, instead of on a new line. Is there a way to have all cfdump output to be on a seperate line?

And if not, maybe there is a better way to output debug information in a seperate window. Using cfdump in a console is even handy on a production server: it is a simple way to monitor what is going on.

Thanks for your replies.

Marcel


Legentigger

unread,
Mar 27, 2013, 5:42:25 PM3/27/13
to ra...@googlegroups.com
I will answer this myself:

You will have to change the code of dump.cfc inside /opt/railo/lib/railo-server/context/library/tag/

Change line 103 inside dump.cfc from

systemOutput(result);

into:

systemOutput(result & Chr(10));

Restart Railo and the output in the console will be nice and tidy.





Michael Offner

unread,
Mar 28, 2013, 2:18:22 AM3/28/13
to ra...@googlegroups.com
You can also do systemoutput(result,true);
But i think this works not by accident this way, do you know how ACF behaves in this case. 

Micha

Von meinem iPhone gesendet
--
Need help right now? Why not have one of the Railo Team help you directly: http://www.getrailo.com/index.cfm/consulting/
---
You received this message because you are subscribed to the Google Groups "Railo" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Legentigger

unread,
Mar 28, 2013, 11:36:56 AM3/28/13
to ra...@googlegroups.com
ACF will put the output of every used cfdump on its own line, unless of course you're dumping a complex structure. What I noticed is that Railo dumps simple values right next to eachother on the same line. This is different behaviour and I prefer the way it is done in AFC. The console can then be used as a live view of your server. 

Igal Sapir

unread,
Mar 28, 2013, 11:47:31 AM3/28/13
to Railo List

Can you post screenshots that show the difference that you're referring to?

--
typos, misspels, and other weird words brought to you courtesy of my mobile device and its auto-(in)correct feature.

On Mar 28, 2013 8:36 AM, "Legentigger" <tegen...@gmail.com> wrote:
ACF will put the output of every used cfdump on its own line, unless of course you're dumping a complex structure. What I noticed is that Railo dumps simple values right next to eachother on the same line. This is different behaviour and I prefer the way it is done in AFC. The console can then be used as a live view of your server. 

--

Legentigger

unread,
Mar 28, 2013, 3:39:39 PM3/28/13
to ra...@googlegroups.com

Original ACF<cfdump var="some single line" output="console"> example (blue background is because of my settings):

Original Railo <cfdump var="some single line" output="console"> example:

Adpated Railo <cfdump var="some single line" output="console"> example: (dumps are now each on a line)



Igal @ getRailo.org

unread,
Mar 28, 2013, 3:57:24 PM3/28/13
to ra...@googlegroups.com
I see.  as Micha pointed out it'd be better to use the boolean arg of SystemOutput, so it would be:

    systemOutput( result, true );    // true will add a new line

as that will be a more "platform independent" solution [Windows for example adds chr(13) and chr(10) instead of just chr(10)]

@Micha -- IMO the default value for systemOutput's addNewLine should be true and not false, but I'm not sure if it'd be a good idea to change that with respect to backward compatibility.


Igal

Michael Offner

unread,
Mar 29, 2013, 4:00:00 AM3/29/13
to ra...@googlegroups.com
Systemoutput was inspired by writeoutput and in this case we have no nl.
-1 from me for default true.

Micha

Von meinem iPad gesendet
Reply all
Reply to author
Forward
0 new messages