North State Framework in C#  V3.0.0
An object-oriented framework for implementing UML state machines.
Public Member Functions | Protected Member Functions | Properties | List of all members
NSFTraceLog Class Reference

Represents a trace log. More...

Inheritance diagram for NSFTraceLog:
NSFTaggedObject NSFUniquelyNumberedObject INSFNamedObject

Public Member Functions

 NSFTraceLog (NSFString name)
 Creates a trace log More...
 
void addTrace (NSFString type, NSFString tag, NSFString data)
 Adds a trace to the log. More...
 
void addTrace (NSFString type, NSFString tag1, NSFString data1, NSFString tag2, NSFString data2)
 Adds a trace to the log. More...
 
void addTrace (NSFString type, NSFString tag1, NSFString data1, NSFString tag2, NSFString data2, NSFString tag3, NSFString data3)
 Adds a trace to the log. More...
 
bool allTracesLogged ()
 Have all traces that have been added been logged More...
 
void saveLog ()
 Saves the trace log to a file with the name of the log. More...
 
void saveLog (NSFString fileName)
 Saves the trace log to the specified filename. More...
 
- Public Member Functions inherited from NSFTaggedObject
 NSFTaggedObject (NSFString name)
 Creates an object with a unique id and a name. More...
 
- Public Member Functions inherited from NSFUniquelyNumberedObject
 NSFUniquelyNumberedObject ()
 Creates a uniquely numbered object. More...
 
bool isSameObject (NSFUniquelyNumberedObject other)
 Checks if this object is the same as another object. More...
 

Protected Member Functions

void addTraceToLog (NSFEventContext context)
 Reaction that does the work adding a trace element to the log. More...
 
void saveTrace (NSFEventContext context)
 Reaction that does the work of saving the file. More...
 

Properties

static NSFTraceLog PrimaryTraceLog [get]
 Gets the framework trace log. More...
 
bool Enabled [get, set]
 Gets or sets the flag indicating if tracing is enabled. More...
 
UInt32 MaxTraces [get, set]
 Gets or sets the maximum number of trace entries in the log. More...
 
- Properties inherited from NSFTaggedObject
NSFString Name [get, set]
 
- Properties inherited from NSFUniquelyNumberedObject
NSFId UniqueId [get]
 Gets or sets the unique id of the object. More...
 
- Properties inherited from INSFNamedObject
NSFString Name [get]
 Gets the name of the object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from NSFUniquelyNumberedObject
static NSFId getNextUniqueId ()
 Gets the next unique id. More...
 

Detailed Description

Represents a trace log.

Constructor & Destructor Documentation

Creates a trace log

Parameters
nameThe name of the log.

By default, thread priority is set to lowest.

Member Function Documentation

void addTrace ( NSFString  type,
NSFString  tag,
NSFString  data 
)

Adds a trace to the log.

Parameters
typeThe type of the trace.
tagThe tag associated with the trace.
dataThe data associated with the tag.
void addTrace ( NSFString  type,
NSFString  tag1,
NSFString  data1,
NSFString  tag2,
NSFString  data2 
)

Adds a trace to the log.

Parameters
typeThe type of the trace.
tag1The first tag associated with the trace.
data1The data associated with the first tag.
tag2The second tag associated with the trace.
data2The data associated with the second tag.
void addTrace ( NSFString  type,
NSFString  tag1,
NSFString  data1,
NSFString  tag2,
NSFString  data2,
NSFString  tag3,
NSFString  data3 
)

Adds a trace to the log.

Parameters
typeThe type of the trace.
tag1The first tag associated with the trace.
data1The data associated with the first tag.
tag2The second tag associated with the trace.
data2The data associated with the second tag.
tag3The third tag associated with the trace.
data3The data associated with the third tag.
void addTraceToLog ( NSFEventContext  context)
protected

Reaction that does the work adding a trace element to the log.

Parameters
contextAdditional contextual information.
bool allTracesLogged ( )

Have all traces that have been added been logged

Returns
True if the NSFTraceLog has logged all the added traces. False if there are traces that have yet to be processed.
void saveLog ( )

Saves the trace log to a file with the name of the log.

The trace log is saved in xml format.

void saveLog ( NSFString  fileName)

Saves the trace log to the specified filename.

Parameters
fileNameThe relative or fully qualified name for the file.

The trace log is saved in xml format.

void saveTrace ( NSFEventContext  context)
protected

Reaction that does the work of saving the file.

Parameters
contextAdditional contextual information.

Property Documentation

bool Enabled
getset

Gets or sets the flag indicating if tracing is enabled.

If tracing is disabled, no additions will be made to the trace log.

UInt32 MaxTraces
getset

Gets or sets the maximum number of trace entries in the log.

Once the trace limit is reached, old traces are deleted in favor of new ones.

NSFTraceLog PrimaryTraceLog
staticget

Gets the framework trace log.

This log is where framework traces are recorded, and where static logging operations record traces. Most application use this log for custom trace recording, as well.




Copyright 2004-2014, North State Software, LLC. All rights reserved.