cylo logo Bookmark and Share

CyloStackTrace Stack Trace Implementation V_0.1
(ERROR GETS ADDED TO BOTTOM OF PAGE)

This is version 0.1 of CyloStackTrace, which acts similar to PHP's stack trace mechanism.

To use CyloStackTrace, include the scripts in your page using ...

<script type="text/javascript" src='js/CyloStackTrace.js'></script>
Before you start you should set some defaults.

There are two default settings to concider


1. Weather to display the trace on an error imediatly.

By default the trace will not display. To display traces on errors use the following code in your script.

CyloStackTrace.auto_display=true;


2. The method in which to display the trace. kaka

CyloStackTrace is best used inside nested functions so you can trace which functions were called and what was passed.

Below is an example of to use CyloStackTrace

function startFunction(value)
 {
	try
	{
		alert("Function called");
		alerrt("This should cause an error");
		CyloStackTrace.stackTrace(arguments,"OK");
	}
	catch (err)
	{
		CyloStackTrace.stackTrace(arguments,err.description,"
Some extra text for debugging ("+value+")");
} }


FEATURES!

1. You can specify a display type for ease user reporting. Once the trace is displayed there are 4 options displayed along with the trace. You can change the output of the trace and even copy the output to the clipbaord ready for your users to post into support email.

THINGS TO BE AWARE OF!

1. As you may have noticed the trace appears at the bottom of the page.

2. You must put all your code into try{} catch{} statements.

3. It will not take up memory when there are no errors. The stack is only called when an error happens. The functions to store the trace are called but are not fully executed unless an error has been recorded.

COMMENT ON THIS PLUG-IN

If you'd like to leave some feed back or would like to request a feature, please drop me a line on this google group ...

http://groups.google.com/group/cylo-web-tools?hl=en

VIEW SOURCE TO GET THE FILES