com.cisco.services.tracing
Interface TraceWriter

All Known Subinterfaces:
TraceWriterManager
All Known Implementing Classes:
BaseTraceWriter, ConsoleTraceWriter, LogFileTraceWriter, OutputStreamTraceWriter, SyslogTraceWriter, TraceWriterManagerImpl

public interface TraceWriter

Introduction

The TraceWriter interface abstracts the details of trace message output. The TraceWriter uses its enabled method to advertise whether or not the print and println methods will have any effect. Users of TraceWriter should use the value returned by the getEnabled method as an indication of whether they should invoke the print and println methods at all.


Method Summary
 void close()
          Releases any resources associated by this TraceWriter.
 void flush()
          Forces output of any messages that have been printed using the println method
 java.lang.String getDescription()
           
 boolean getEnabled()
          Returns whether the println method will print anything or not.
 java.lang.String getName()
           
 int[] getTraceLevels()
           
 void println(java.lang.String message, int severity)
          Prints the specified string followed by a carriage return The concrete TraceWriter class will use the severity to block out messages from a particular stream.
 void setTraceLevels(int[] levels)
          set the trace levels that will be traced by this TraceWriter
 

Method Detail

println

void println(java.lang.String message,
             int severity)
Prints the specified string followed by a carriage return The concrete TraceWriter class will use the severity to block out messages from a particular stream. Each trace writer has a notion of the highest level tarce it traces

Parameters:
message - The string to print
severity - The severity of the trace.
See Also:
Trace

flush

void flush()
Forces output of any messages that have been printed using the println method


close

void close()
Releases any resources associated by this TraceWriter.


getEnabled

boolean getEnabled()
Returns whether the println method will print anything or not. A closed TraceWriter will always return false from this method.

Returns:
true if this TraceWriter is enabled, false if not

setTraceLevels

void setTraceLevels(int[] levels)
set the trace levels that will be traced by this TraceWriter

Parameters:
levels - Array of trace levels
See Also:
Trace

getTraceLevels

int[] getTraceLevels()
Returns:
the array of trace levels that will be traced by this TraceWriter

getName

java.lang.String getName()
Returns:
the name of this TraceWriter

getDescription

java.lang.String getDescription()
Returns:
a short description of this TraceWriter