log4net •  C++ •  VB6 •  VBA •  .NET  •  Silverlight •  Windows Phone 7 •  ASP.NET

Universal Trace Monitor for Software Developers and Testers

Using DevTracer with VBScript (Scripting Host / Classical ASP)

The trace monitor can be used with scripting languages as well.

When using scripting, the COM component provided with DevTracer must be used. Here is an example for a script DevTracer.vbs, which can be started using the command line with:

cscript DevTracer.vbs

option explicit

dim tracer
' create the COM object
set tracer = createobject("nrsoftware.devtracer")

' set ip-address(localhost) and port no. (12345)
tracer.Init "localhost",12345

' optional : set application name
tracer.ApplicationName = "Devtracer.vbs"

'set indent size
tracer.IndentSize = 4

tracer.WriteLine "hello world"
tracer.Indent
tracer.WriteLine "hello 1 indent"
tracer.Indent
tracer.WriteLine "hello 2 indent"
tracer.Unindent
tracer.Unindent

tracer.Writeline "done!"
wscript.sleep 100
DevTracer.vbs Download

 

Note the usage of wscript.sleep. For performance reasons (DevTracer should not slow down the application), the trace information is send using a background thread. The thread is automatically terminated with the application. The call to wscript.sleep gives the thread time to send all information not send yet.