com.cisco.services.tracing
Interface Trace

All Known Subinterfaces:
ConditionalTrace, UnconditionalTrace
All Known Implementing Classes:
ConditionalTraceImpl, TraceImpl, UnconditionalTraceImpl

public interface Trace

The Trace interface defines the methods that allow application tracing. Trace also defines the standard trace types as specified by Syslog Trace Logging.Syslog currently defines 8 levels of trace. The severity of the message is indicated in the trace as a number ranging between [0-7] (0 and 7 included). Currently 7 is HIGHEST_LEVEL and 0 is the LOWEST_LEVEL trace. All 8 levels are predefined here as static int types for reference in tracing sub-system implementations.

The severities traced are as follows:
0 = EMERGENCIES System unusable
1 = ALERTS Immediate action needed
2 = CRITICAL Critical conditions
3 = ERROR Error conditions
4 = WARNING Warning conditions
5 = NOTIFICATION Normal but significant condition
6 = INFORMATIONAL Informational messages only
7 = DEBUGGING Debugging messages


Field Summary
static int ALERTS
          The application will continue working on the tasks but all functions may not be operational (one or more devices in the list are not accessible but others in the list can be accessed)
Syslog severity level = 1
static java.lang.String ALERTS_TRACE_NAME
          String descriptor for ALERTS trace level
static int CRITICAL
          A critical failure, the application can not accomplish the tasks required due to this failure, eg: the app can't open the database to read the device list
Syslog severity level = 2
static java.lang.String CRITICAL_TRACE_NAME
          String descriptor for CRITICAL trace level
static int DEBUGGING
          Very detailed information regarding errors or processing status that is only generated when DEBUG mode has been enabled
Syslog severity level = 7
static java.lang.String DEBUGGING_TRACE_NAME
          String descriptor for the DEBUGGING trace level
static int EMERGENCIES
          Emergency situation, a system shutdown is necessary
Syslog severity level = 0
static java.lang.String EMERGENCIES_TRACE_NAME
          String descriptor for EMERGENCIES trace level
static int ERROR
          An error condition of some kind has occurred and the user needs to understand the nature of that failure
Syslog severity level = 3
static java.lang.String ERROR_TRACE_NAME
          String descriptor for ERROR trace level
static int HIGHEST_LEVEL
          The highest trace level, currently this is DEBUGGING with a trace level of 7
static int INFORMATIONAL
          Information of some form not relating to errors, warnings, audit, or debug
Syslog severity level =6
static java.lang.String INFORMATIONAL_TRACE_NAME
          String descriptor for INFORMATIONAL trace level
static int LOWEST_LEVEL
          The lowest trace level, currently this is EMERGENCIES with a trace level of 0
static int NOTIFICATION
          Notification denotes a normal but significant condition
Syslog severity level = 5
static java.lang.String NOTIFICATION_TRACE_NAME
          String descriptor for NOTIFICATION trace level
static int WARNING
          Warning that a problem of some form exists but is not keeping the application from completing its tasks
Syslog severity level = 4
static java.lang.String WARNING_TRACE_NAME
          String descriptor for WARNING trace level
 
Method Summary
 java.lang.String getName()
          Returns the name of this Trace object.
 java.lang.String getSubFacility()
          Returns the subFacility of trace
 int getType()
          Returns the type of trace.
 boolean isEnabled()
          Returns the state of this Trace object.
 void println(java.lang.Object object)
          Prints the string returned by the Object.toString() method and terminates the line as defined by the system.
 void println(java.lang.String message)
          Prints a message in the same format as Trace.print() and terminates the line as defined by the system.
 void println(java.lang.String mnemonic, java.lang.Object object)
          Prints the string returned by the Object.toString() method and terminates the line as defined by the system.
 void println(java.lang.String mnemonic, java.lang.String message)
          Prints a message in the same format as Trace.print() and terminates the line as defined by the system.
 void setDefaultMnemonic(java.lang.String mnemonic)
          Sets a default mnemonic for all messages printed out to this trace.
 

Field Detail

DEBUGGING

static final int DEBUGGING
Very detailed information regarding errors or processing status that is only generated when DEBUG mode has been enabled
Syslog severity level = 7

See Also:
Constant Field Values

DEBUGGING_TRACE_NAME

static final java.lang.String DEBUGGING_TRACE_NAME
String descriptor for the DEBUGGING trace level

See Also:
Constant Field Values

INFORMATIONAL

static final int INFORMATIONAL
Information of some form not relating to errors, warnings, audit, or debug
Syslog severity level =6

See Also:
Constant Field Values

INFORMATIONAL_TRACE_NAME

static final java.lang.String INFORMATIONAL_TRACE_NAME
String descriptor for INFORMATIONAL trace level

See Also:
Constant Field Values

NOTIFICATION

static final int NOTIFICATION
Notification denotes a normal but significant condition
Syslog severity level = 5

See Also:
Constant Field Values

NOTIFICATION_TRACE_NAME

static final java.lang.String NOTIFICATION_TRACE_NAME
String descriptor for NOTIFICATION trace level

See Also:
Constant Field Values

WARNING

static final int WARNING
Warning that a problem of some form exists but is not keeping the application from completing its tasks
Syslog severity level = 4

See Also:
Constant Field Values

WARNING_TRACE_NAME

static final java.lang.String WARNING_TRACE_NAME
String descriptor for WARNING trace level

See Also:
Constant Field Values

ERROR

static final int ERROR
An error condition of some kind has occurred and the user needs to understand the nature of that failure
Syslog severity level = 3

See Also:
Constant Field Values

ERROR_TRACE_NAME

static final java.lang.String ERROR_TRACE_NAME
String descriptor for ERROR trace level

See Also:
Constant Field Values

CRITICAL

static final int CRITICAL
A critical failure, the application can not accomplish the tasks required due to this failure, eg: the app can't open the database to read the device list
Syslog severity level = 2

See Also:
Constant Field Values

CRITICAL_TRACE_NAME

static final java.lang.String CRITICAL_TRACE_NAME
String descriptor for CRITICAL trace level

See Also:
Constant Field Values

ALERTS

static final int ALERTS
The application will continue working on the tasks but all functions may not be operational (one or more devices in the list are not accessible but others in the list can be accessed)
Syslog severity level = 1

See Also:
Constant Field Values

ALERTS_TRACE_NAME

static final java.lang.String ALERTS_TRACE_NAME
String descriptor for ALERTS trace level

See Also:
Constant Field Values

EMERGENCIES

static final int EMERGENCIES
Emergency situation, a system shutdown is necessary
Syslog severity level = 0

See Also:
Constant Field Values

EMERGENCIES_TRACE_NAME

static final java.lang.String EMERGENCIES_TRACE_NAME
String descriptor for EMERGENCIES trace level

See Also:
Constant Field Values

LOWEST_LEVEL

static final int LOWEST_LEVEL
The lowest trace level, currently this is EMERGENCIES with a trace level of 0

See Also:
Constant Field Values

HIGHEST_LEVEL

static final int HIGHEST_LEVEL
The highest trace level, currently this is DEBUGGING with a trace level of 7

See Also:
Constant Field Values
Method Detail

isEnabled

boolean isEnabled()
Returns the state of this Trace object. By default, Trace objects are enabled, that is, println() method will always trace. The state may not be changed through this interface, however, this object may implement additional interfaces that allow the state to be changed.

Returns:
true if tracing is enabled, false otherwise
See Also:
ConditionalTrace

println

void println(java.lang.String mnemonic,
             java.lang.String message)
Prints a message in the same format as Trace.print() and terminates the line as defined by the system.

Parameters:
message - the message to be printed
mnemonic - the mnemonic mapped to message to be printed

println

void println(java.lang.String message)
Prints a message in the same format as Trace.print() and terminates the line as defined by the system.

Parameters:
message - the message to be printed

println

void println(java.lang.Object object)
Prints the string returned by the Object.toString() method and terminates the line as defined by the system.

Parameters:
object - the object to be printed

println

void println(java.lang.String mnemonic,
             java.lang.Object object)
Prints the string returned by the Object.toString() method and terminates the line as defined by the system.

Parameters:
object - the object to be printed
mnemonic - the mnemonic mapped to message to be printed

getName

java.lang.String getName()
Returns the name of this Trace object.

Returns:
the name of this Trace object

setDefaultMnemonic

void setDefaultMnemonic(java.lang.String mnemonic)
Sets a default mnemonic for all messages printed out to this trace.

Parameters:
mnemonic - a mnemonic string

getType

int getType()
Returns the type of trace.

Returns:
the trace severity as specified in Syslog. DEBUGGING, INFORMATIONAL, WARNING, etc.

getSubFacility

java.lang.String getSubFacility()
Returns the subFacility of trace

Returns:
the trace subFacility type