It is especially useful for debugging what has been coined "Web 2.0" code.
jsTracer was written to help fill this void.
jsTracer stands out by providing the following features.
- Ease of use
- Cross browser compatibility
- Stack trace viewer
- Avoid "slow script" warnings during heavy tracing
- Message ordering that makes sense
- Message highlighting
- Custom CSS for messages
- Professional GUI
There are some simple trace statements being generated by mouse events on this page. Keep your eye peeled for them as you read along.
A Brief Tutorial
Include the jsTracer.js file in your page.
Start writing messages.
Thats it! It doesn't get much simpler than that; however, there are some tips and tricks that will improve your user experience with jsTracer.
jsTracer supports 3 message types.
jstracer.MessageType.INFOTo specify a message type, simply pass it as the second argument to the write method.jstracer.write("An error message!", jstracer.MessageType.ERROR);
- Info = 1 (default)
- Warning = 2
- Error = 3
jstracer.write("An error message!", 3);
You can add custom CSS to your trace statements to help delineate them from other messages. Simply pass your
CSS as the third argument to the write method.
jstracer.write("Use custom CSS", 1, "background-color:green;color:white;font-weight:bold");
The stack trace option is off by default, so in order to collect stack information on trace statements
that are written prior to page load, you will need to enable stack collection via script like so: