Contains all the error codes and macros to control error logging and return values.
Error Definitions | Contains all the error codes and macros to control error logging and return values. |
Definitions | |
Precompiler Options | |
Default Values | |
Macros | |
STRINGIZE(s) | Use this to write out a precompiler attribute as a char*. |
Errors | Contains only a single variable responsible for returning and signaling a fatal error |
Variables | |
tError | This is used to specify a fatal error and is used to fall out of the program when detected. |
Logger | Contains the FileLogger class and the static log file that is opened at the beginning of the program |
External Variables | |
LOG | FileLogger type that’s used for all the logging during the running of the program |
FileLogger | Used to log everything during the runtime of the program. |
Functions | |
FileLogger | Just initializes the class into an invalid state |
FileLogger | Opens a file for input. |
OpenFile | Opens a file for input |
CloseFile | Closes up the opened file and puts the class into an invalid state |
operator<< | |
~FileLogger | Closes the file. |
Variables | |
_Stream | std::fstream The stream that links to the filename for logging |
_Mutex | boost::recursive_mutex that protects the class from multiple threads accessing the _Stream at the same time. |
Error Handling | |
Definitions | |
Error Levels | Define these in the top of your program before <errdef.h> to control what types of errors are logged and what aren’t. |
Fatal Error Codes | All of the fatal errors send an error code into Errors::tError that are defined by one of these definitions. |
Main Program | |
game.cpp | |
d3d.cpp | |
ddraw.cpp | |
startup.cpp | |
gdi.cpp | |
resources.cpp | |
Macros | |
LOG_FATAL | Used to log a fatal error into the static FileLogger Logger::LOG. |
namespace Logger
Contains the FileLogger class and the static log file that is opened at the beginning of the program
External Variables | |
LOG | FileLogger type that’s used for all the logging during the running of the program |
FileLogger type that’s used for all the logging during the running of the program
extern FileLogger LOG;
class FileLogger
Used to log everything during the runtime of the program. Is thread safe and can be controlled directly for greater control or very long, unbroken streams.
Functions | |
FileLogger | Just initializes the class into an invalid state |
FileLogger | Opens a file for input. |
OpenFile | Opens a file for input |
CloseFile | Closes up the opened file and puts the class into an invalid state |
operator<< | |
~FileLogger | Closes the file. |
Variables | |
_Stream | std::fstream The stream that links to the filename for logging |
_Mutex | boost::recursive_mutex that protects the class from multiple threads accessing the _Stream at the same time. |
Definitions | |
Error Levels | Define these in the top of your program before <errdef.h> to control what types of errors are logged and what aren’t. |
Fatal Error Codes | All of the fatal errors send an error code into Errors::tError that are defined by one of these definitions. |
Main Program | |
game.cpp | |
d3d.cpp | |
ddraw.cpp | |
startup.cpp | |
gdi.cpp | |
resources.cpp | |
Macros | |
LOG_FATAL | Used to log a fatal error into the static FileLogger Logger::LOG. |
Define these in the top of your program before <errdef.h> to control what types of errors are logged and what aren’t.
All of the fatal errors send an error code into Errors::tError that are defined by one of these definitions.
Used to log a fatal error into the static FileLogger Logger::LOG. Only defined if the error level is FATAL or above (which is default behavior).
#define LOG_FATAL(x) { boost::recursive_mutex::scoped_lock l(LOG._Mutex); LOG << "FATAL: " << x << endl; };
x | This is the string that can be operator<< to a std::fstream. |
Contains only a single variable responsible for returning and signaling a fatal error
namespace Errors
This is used to specify a fatal error and is used to fall out of the program when detected.
extern int volatile tError
Contains the FileLogger class and the static log file that is opened at the beginning of the program
namespace Logger
Used to log everything during the runtime of the program.
class FileLogger
Just initializes the class into an invalid state
FileLogger( ) : Valid(false)
Opens a file for input
int OpenFile( char * logName, std::ios:: openmode mode )
Closes up the opened file and puts the class into an invalid state
void CloseFile()
Closes the file.
~FileLogger()
std::fstream The stream that links to the filename for logging
std::fstream _Stream
boost::recursive_mutex that protects the class from multiple threads accessing the _Stream at the same time.
boost::recursive_mutex _Mutex