jeErrorLog

Last Updated May 4, 2000

Types

jeErrorLog;

This object stores a log of errors.

Notes:
    from ERRORLOG.H:  Temporary structure forward, to hold place for when jeThreadQueue is fully implemented.


Constants:

jeErrorLog_ErrorIDEnumType;

DO NOT USE THESE ERROR, DEPRECATED.  Some references still exist in source code but are to be removed eventually, use jeErrorLog_ErrorClassType instead.
typedef enum{
    JE_ERR_DRIVER_INIT_FAILED=500,          // Could not init Driver
    JE_ERR_DRIVER_NOT_FOUND,                // File open error for driver
    JE_ERR_DRIVER_NOT_INITIALIZED,          // Driver shutdown failure
    JE_ERR_INVALID_DRIVER,                  // Wrong driver version, or bad driver
    JE_ERR_DRIVER_BEGIN_SCENE_FAILED,
    JE_ERR_DRIVER_END_SCENE_FAILED,
    JE_ERR_NO_PERF_FREQ,
    JE_ERR_FILE_OPEN_ERROR,
    JE_ERR_INVALID_PARMS,
    JE_ERR_OUT_OF_MEMORY,
} jeErrorLog_ErrorIDEnumType;


jeErrorLog_ErrorClassType;

typedef enum{
    JE_ERR_MEMORY_RESOURCE,
    JE_ERR_DISPLAY_RESOURCE,
    JE_ERR_SOUND_RESOURCE,
    JE_ERR_SYSTEM_RESOURCE,
    JE_ERR_INTERNAL_RESOURCE,

    JE_ERR_FILEIO_OPEN,
    JE_ERR_FILEIO_CLOSE,
    JE_ERR_FILEIO_READ,
    JE_ERR_FILEIO_WRITE,
    JE_ERR_FILEIO_FORMAT,
    JE_ERR_FILEIO_VERSION,

    JE_ERR_LIST_FULL,
    JE_ERR_DATA_FORMAT,
    JE_ERR_BAD_PARAMETER,
    JE_ERR_SEARCH_FAILURE,

    JE_ERR_WINDOWS_API_FAILURE,
    JE_ERR_SUBSYSTEM_FAILURE,
    JE_ERR_SHADER_SCRIPT,
} jeErrorLog_ErrorClassType;


Functions:

jeErrorLog_Add(Error, Context);

This is a convenience macro that adds a line to the error log with a string Error to describe the error and a string Context to describe the context of the error.

Returns: nothing.

Notes:
    from ERRORLOG.H: logs an error.


JETAPI void jeErrorLog_AddExplicit(jeErrorLog_ErrorClassType, const char* ErrorIDString, const char* ErrorFileString, int LineNumber, const char* UserString, const char* Context);

This function explicitly specifies the information to add to the errorlog including the the jeErrorLog_ErrorClassType, the textual name of the error class type, the name of the file in which the error occurs, the line of the file at which the error occurs, a user specifed string, and a string specifying the context of the error.  This is called by the various error macros and usually is not used directly.

Returns:  nothing.

Notes:
    from ERRORLOG.H: not intended to be used directly; use ErrorLog_Add or ErrorLog_AddString
 

jeErrorLog_AddString(Error, String, Context);
This is a convenience macro that adds a line to the error log with a string Error to describe the error, a string Context to describe the context of the error, and an additional user definable string String for further explanation.  Note that in a release build the String is not recorded.

Returns: nothing.

Notes:
    from ERRORLOG.H: logs an error with additional identifing string.


jeErrorLog_AppendString(String);

This is a convenience macro that appends an additional string String to the last recorded error entry.  Note that in release mode this is does nothing.

Returns: nothing.

Notes:
    from ERRORLOG.H: adds text to the previous logged error


JETAPI jeBoolean jeErrorLog_AppendStringToLastError(const char* String);

This function appends the string String to the end of the last recorded error message.  This function is used by _AppendString and should not normally be used directly.

Returns:  JE_TRUE on success, JE_FALSE otherwise.

Notes:
    from ERRORLOG.H: use jeErrorLog_AppendString

JETAPI void jeErrorLog_Clear(void);
This function clears out the error log buffer.

Returns: nothing.

Notes:
    from ERRORLOG.H: clears error history


JETAPI int jeErrorLog_Count(void);

This function returns the number of entries currently stored in the error log.

Returns: the result.

Notes:
    from ERRORLOG.H: reports size of current error log


JETAPI const char* jeErrorLog_IntToString(int Number);

This function takes an integer and returns its string representation.  (Basically itoa())  This is used with jeErrorLog_AddString

Returns:  the string representation

Notes:
    from ERRORLOG.H:  turns Number into a string.  uses a fixed static character string.  for use with the context parameter of jeErrorLog_AddString()

JETAPI jeBoolean jeErrorLog_Report(int History, jeErrorLog_ErrorClassType* Error, const char** UserString, const char** Context);
This function plucks the specified entry History (0 for most recent, 1 for second most recent, etc.) from the error log, returning the geErrorLog_ErrorClassType Error, the string UserString, and the string Context.

Returns: JE_TRUE on success, JE_FALSE otherwise.

Notes:
    from ERRORLOG.H: reports from the error log. history is 0 for most recent,  1.. for second most recent etc. returns JE_TRUE if report succeeded.  JE_FALSE if it failed.