How do you do debug output from within services?

I have what's undoubtedly a simple coding error in a service, but
there doesn't seem to be a clean way to dump out the relevant values
so I can examine them.

The log object isn't defined, which I suppose makes sense if model
elements are supposed to be decoupled from the surrounding app. I
could inject it into this service or my BaseService while I'm looking
at this bug, or maybe in a dev environment, but I wondered if there
was a better way.

Related, and not only relevant to this situation, as a
semi-last-resort, I threw an error whose msg contained the values I
want to see (they're simple values, not always true). Got the "Oops!
Exception Encountered" screen, stack trace and all, but neither the
message nor the detail of that exception were shown. That seems both
odd and not constructive. Is this a config thing? I suppose it's an
error template thing (haven't explored custom error templates yet),
but it seems like strange out of the box behavior.

Dave

You want to start looking at step-debugging. CFEclipse and CFBuilder both support it and it’s really useful.

CFBuilder setup is slightly different (but works the same), here’s some info on starting out with CFEclipse:
http://www.adobe.com/devnet/coldfusion/articles/debugger.html

Yes, I agree, step debugging would be really useful for low-level
issues like this. Unfortunately, I'm using JetBrains IDEA for CFML,
which I truly love, and not Eclipse/Builder, which, um, I don't.

IDEA supports debugging an a number of the other languages it
supports, and several companies have indicated that their debuggers
were written with other hosts in mind, and have specifically expressed
interest in partnering with JetBrains, so there's hope. However,
though some user noise has been made about this, frankly I haven't
seen any evidence that JetBrains is moving in that direction. Very too
bad in my book. IDEA's really good.

Any ideas short of that?

Dave

Sorry, I don’t know much about IDEA. Might be worth contacting the guys at Integral who write FusionDebug and ask them if they support IDEA. http://www.fusion-debug.com/fd/

If you are using ColdFusion Builder then I suggest you look into the line
debugger, it is invaluable at all times.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of enigment
Sent: Sunday, 10 October 2010 9:51 PM
To: coldbox@googlegroups.com
Subject: [coldbox:6168] How do you do debug output from within services?

I have what's undoubtedly a simple coding error in a service, but there
doesn't seem to be a clean way to dump out the relevant values so I can
examine them.

The log object isn't defined, which I suppose makes sense if model

elements

are supposed to be decoupled from the surrounding app. I could inject it

into

this service or my BaseService while I'm looking at this bug, or maybe in

a dev

environment, but I wondered if there was a better way.

Related, and not only relevant to this situation, as a semi-last-resort, I

threw

an error whose msg contained the values I want to see (they're simple
values, not always true). Got the "Oops!
Exception Encountered" screen, stack trace and all, but neither the

message

nor the detail of that exception were shown. That seems both odd and not
constructive. Is this a config thing? I suppose it's an error template

thing

(haven't explored custom error templates yet), but it seems like strange

out

The FusionDebug folks are one of the companies that specifically said
their product is designed to integrate with different IDE's, and said
they'd be very interested in IDEA. However, they wanted some kind of
"sponsorship" from JetBrains, and I don't know what that means.
Probably money, developer time, or both, if I had to guess, and
JetBrains so far hasn't responded.

Anyway, while I'd love it if my favorite CFML IDE had step debugging,
that's not what I was trying to ask about here. There are other ways
to inspect variable values and announce when particular sections of
code are running, it's just harder in code that can't output to the
screen. ColdBox has some pretty sophisticated debugging tools, but
they're not so readily available from within services, and I was
wondering if folks with more CB experience had any other strategies up
their sleeves.

Dave