|
tracefctxx
1.1.8
|
#include <TraceFct.h>
Public Member Functions | |
| TraceFct (string &name) | |
| TraceFct (string name, bool print_it, int num_fct_to_print) | |
| ~TraceFct () | |
| TraceFct (const char *name) | |
| Function entry constructor. More... | |
Static Public Member Functions | |
| static void | exit (int exit_code, const string &msg) |
| static void | die (const string &msg) |
| static void | message (const string &msg) |
| static void | println (const string &msg) |
| static void | dump_stack (void) |
| Print the current function stack. More... | |
Exit | |
These functions print an error message to | |
| static void | exit (int exit_code, const char *format,...) |
| Exit a program, dumping the function stack. More... | |
| static void | exit (int exit_code, Exception &ex) |
| Exit a program, dumping the function stack. More... | |
| static void | die (const char *format,...) |
| Exit a program with error EXIT_FAILURE, dumping the function stack. More... | |
| static void | die (Exception &ex) |
| Exit a program with error EXIT_FAILURE, dumping the function stack. More... | |
Messages | |
The The | |
| static void | message (const char *format,...) |
Print a formatted message to the tracefct output stream. More... | |
| static void | message (Exception &ex) |
Print a message to the tracefct output stream. More... | |
| static void | vmessage (const char *format, va_list args) |
Print a formatted message to the tracefct output stream using a stdargs argument list. More... | |
| static void | println (Exception &ex) |
Print a message to the tracefct output stream. More... | |
| static void | println (const char *msg) |
Print a message to the tracefct output stream. More... | |
Output Stream manipulation | |
| static void | open (const string &filename) |
redirect the tracefct output stream More... | |
| static void | close (void) |
reset the tracefct output stream to stderr. More... | |
The TraceFct Class
| TraceFct::TraceFct | ( | const char * | name | ) |
Function entry constructor.
| name | the name of the function |
This constructor is used when entering a function which should be registered.
| TraceFct::~TraceFct | ( | ) |
The destructor.
|
static |
reset the tracefct output stream to stderr.
close() resets the output stream to stderr, closing the file previously opened by TraceFct::open().
|
static |
Exit a program with error EXIT_FAILURE, dumping the function stack.
| format | a printf style format string |
| ... | additional arguments |
|
inlinestatic |
Exit a program with error EXIT_FAILURE, dumping the function stack.
| ex | The Exception Stack to print |
This version of the exit function will print out the passed Exception stack.
References exit().
|
static |
Print the current function stack.
| ostr | the output file stream |
This prints the current function stack to the TraceFct output stream
|
static |
Exit a program, dumping the function stack.
| exit_code | the exit code to be returned to the system |
| format | a printf style format string |
| ... | additional arguments |
Referenced by die().
|
static |
Exit a program, dumping the function stack.
| exit_code | the exit code to be returned to the system |
| ex | The Exception Stack to print |
This version of the exit function will print out the passed Exception stack.
|
static |
Print a formatted message to the tracefct output stream.
| format | a printf style format string |
| ... | additional arguments |
The message is passed in the same fashion as the arguments to printf, allowing formatted output.
|
inlinestatic |
Print a message to the tracefct output stream.
| ex | The exception to print |
|
static |
redirect the tracefct output stream
| file | the file to which messages are to be written |
\open serves to change the TraceFct output stream to the specified file. Normally TraceFct writes to stderr. TraceFct::exit() always writes to stderr. To reset the output stream, see TraceFct::close(). If the current output stream is not stderr, it is automatically closed.
If the passed filename is the string stderr, open() will use stderr.
Upon error, it writes and exit to stderr and exits.
|
inlinestatic |
Print a message to the tracefct output stream.
| ex | the exception to print |
|
inlinestatic |
Print a message to the tracefct output stream.
| msg | a message to print |
|
static |
Print a formatted message to the tracefct output stream using a stdargs argument list.
| format | a printf style string |
| args | The error message is passed in the same fashion as the arguments to vprintf. Note that vmessage expects a va_list to be passed, rather than a variable argument list. |