s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
Next
Previous
Contents
4. File debug.cpp// From your browser save this file as text-file named as 'debug.cpp'.
#ifdef DEBUG_PRT #include "debug.h" // Variable value[] can be char, string, int, unsigned long, float, etc... void local_dbg(char name[], char value[], char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %s\n", fname, lineno, name, value ); } void local_dbg(char name[], int value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %d\n", fname, lineno, name, value ); } void local_dbg(char name[], unsigned int value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %d\n", fname, lineno, name, value ); } void local_dbg(char name[], long value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %ld\n", fname, lineno, name, value ); } void local_dbg(char name[], unsigned long value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %ld\n", fname, lineno, name, value ); } void local_dbg(char name[], short value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %d\n", fname, lineno, name, value ); } void local_dbg(char name[], unsigned short value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %d\n", fname, lineno, name, value ); } void local_dbg(char name[], float value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %f\n", fname, lineno, name, value ); } void local_dbg(char name[], double value, char fname[], int lineno, bool logfile) { printf("\nDebug %s Line: %d %s is = %f\n", fname, lineno, name, value ); } // You add many more here - value can be a class, ENUM, datetime, etc... #endif // DEBUG_PRT Next Previous Contents |