[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a though to help with debugging ns
On Fri, 21 Jan 2000, Mark Allman wrote:
> > Since the variables are class variables and have local scope, why
> > not just be clear and consistent and call them *all* debug_ ?
>
> Nice. That would be better, I think.
Additional twist:
define and bind verbose_ similarly, and
#define NOW Scheduler::instance().clock()
consistently across ns. That will make it easier to write
self-documenting code to explain functionality and track the operation
of anything you're interested in.
if (verbose_) {
printf("Doing foo at time %.3f\n",NOW);
}
and
if {[$tcp0 set verbose_]} {
puts "extra stuff about configuration info below"
}
Arguably better than comments. The difference between verbose_ and
debug_ is that debug_ never gets used in release code...
(How would you create a bound class variable - myname_ say,with the
full name and network location of the object it belongs to, for
printing out?)
L.
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>