(keitai-l) Re: printStackTrace manipulation

From: Paul Lester <pbl1_at_cornell.edu>
Date: 01/07/05
Message-ID: <41DE04FC.5FB5D3A5@cornell.edu>
    It may not be supported in CLDC but you can get the stack trace from the
Throwable object.  I do this in regular java to create custom stack traces.
(I don't do much CLDC dev just CLDC testing).
----------
    Here's an excerpt from a windows program I am working on for fun.

    Assume err is an Exception that extends Throwable.
    CR is a windows Carriage return (or unix or mac..whatever I feel like)

   StackTraceElement[] elements = err.getStackTrace();
   String output =err.getClass()+":"+err.getMessage()+CR;
   for(int erri=0;erri<elements.length;erri++)
    output += elements[erri].getClassName()+":"+elements[erri].getLineNumber() + CR;
   UltimaMain.showError(output);
-------------
    As for debugging with applis... you can print debug data straight on top of your app to the screen.
That's the standard method.... (usually before the error occurs and often checking the memory remaining).

Sam Joseph wrote:

> Hi Keitat-l'ers,
>
> So I'm working on a unit test package for Doja phones and I'm trying to
> get the results of the unit-tests sent back over the wire.  I've managed
> to do this on the emulator at least, but now I'm trying to send back the
> output of the printStackTrace() operations - that most useful of
> debugging information.
>
> However it seems that CLDC 1.0 at least is of no help here since the
> printStackTrace() operations cannot point anywhere except System.err and
> System.err is final.  CLDC 1.1 looks no different.
>
> I guess that means there is no way to redirect that output at all ...
>
> Any ideas on ways round this?
>
> Many thanks in advance.
>
> CHEERS> SAM
>
> This mail was sent to address paul@thetamusic.com
> Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/

--
*+*=*+*=*+*=*+*=*+*=*+*=*+*=*+*=*+*=*+*F=m(dv/dt)
Paul B. Lester
thetamusic.com(有)
Chief Engineer

EMAIL: paul@thetamusic.com
--
http://www.thetamusic.com/

personal homepage: http://pbl1.tripod.com/
personal EMAIL: pbl1@cornell.edu
*+*=*+*=*+*=*+*=*+*=*+*=*+*=*+*=*+*=*+*F=m(dv/dt)
Received on Fri Jan 7 05:32:21 2005