JUNOS::Trace::init(1); # turn on all levels of tracing
trace("Trace", "starting rpc; ", ref($request), "sending::\n", $rpc);
trace("Verbose", "--- begin request---\n",
$rpc, ($rpc =~ /\n$/) ? "" : "\n", "--- end request ---\n");
=head1 DESCRIPTION
This module allows its user to define his own categories of trace messages.
These categories can be enabled or disabled, and only the trace messages for
the enabled categories are displayed.
=head1 METHODS
init($ALL, $DO_FLAGS, $DO_FLAGS)
Initializes the module to either enable all trace categories ($ALL = 1),
disable all debgu categories ($ALL = 0),
enable specific categories (@$DO_FLAGS = ('Noice')) or
disable specific categories (@$DONT_FLAGS = ('Always')).
$ALL Output everything if set to a non-zero value.
$DO_FLAGS The trace categories to be enabled on for tracing.
This is a reference to an array of trace categories.
(e.g. @$DO_FLAGS = ('Noise','Always');)
$DONT_FLAGS The trace categories to be disabled for tracing.
This is a reference to an array of trace categories.
(e.g. @$DONT_FLAGS = ('Noise','Always');)
set_dont_trace(@DONT_FLAGS)
This method is called to disable trace categories so the trace messages for these categories won't be displayed.
set_trace(@DO_FLAGS)
This method is called to enable trace categories so the trace messages for these categories will be displayed.
trace($FLAG, @MESSAGE);
Assign a trace message to a trace category. If the category is enabled, this trace message will be displayed immediately.
=head1 SEE ALSO
=head1 AUTHOR
Juniper Junoscript Perl Team, send bug reports, hints, tips, and suggestions
to support@juniper.net.
=head1 COPYRIGHT
Copyright (c) 2001 Juniper Networks, Inc.
All rights reserved.
=2=
THE END |