1 #ifndef CRITICAL_EVENTS_GROUP
2 #define CRITICAL_EVENTS_GROUP
24 #define CAUSE_BREAKPOINT
45 #ifdef ERRORS_ARE_FATAL
46 #define REQUIRE(check) if (!check) CAUSE_BREAKPOINT;
48 #define REQUIRE(check)
79 #define non_continuable_error(c, f, i) \
80 critical_events::FL_non_continuable_error(__FILE__, __LINE__, c, f, i, \
81 "A Non-Continuable Runtime Problem Has Occurred")
82 #define continuable_error(c, f, i) \
83 critical_events::FL_continuable_error(__FILE__, __LINE__, c, f, i, \
84 "Runtime Problem Information")
85 #define console_error(c, f, i) \
86 critical_events::FL_console_error(__FILE__, __LINE__, c, f, i)
87 #define deadly_error(c, f, i) \
88 critical_events::FL_deadly_error(__FILE__, __LINE__, c, f, i)
89 #define out_of_memory_now(c, f) \
90 critical_events::FL_out_of_memory_now(__FILE__, __LINE__, c, f)
118 static void alert_message(
const char *info,
const char *title =
"Alert Message");
145 static void FL_deadly_error(
const char *file,
int line,
const char *classname,
146 const char *function_name,
const char *info);
154 const char *classname,
const char *function_name,
const char *info,
168 const char *classname,
const char *function_name,
const char *info,
178 const char *classname,
const char *function_name);
181 static void FL_console_error(
const char *file,
int line,
const char *error_class,
182 const char *error_function,
const char *info);
188 const char *error_class,
const char *error_function,
189 const char *info,
char *guards_message_space);
193 const char *value,
const char *low,
const char *high,
194 const char *error_addition);
199 static void FL_continuable_error_real(
const char *file,
int line,
200 const char *error_class,
const char *error_function,
const char *info,
Provides a dynamically resizable ASCII character string.
Provides a means of logging events for runtime problems.
static void FL_console_error(const char *file, int line, const char *error_class, const char *error_function, const char *info)
Prints out an error message to the standard error file stream.
static void FL_non_continuable_error(const char *file, int line, const char *classname, const char *function_name, const char *info, const char *title)
Shows the same information as continuable_error, but causes an exit.
static void implement_bounds_halt(const char *the_class_name, const char *func, const char *value, const char *low, const char *high, const char *error_addition)
Provides the real implementation of bounds_halt to save code space.
static void set_critical_events_directory(const basis::astring &directory)
sets the internal location where the critical events will be logged.
static void FL_out_of_memory_now(const char *file, int line, const char *classname, const char *function_name)
Causes the program to exit due to a memory allocation failure.
static void write_to_critical_events(const char *message)
sends the "message" to the critical events log file.
static basis::astring critical_events_directory()
returns the current location where critical events are written.
static basis::astring system_error_text(basis::un_int error_to_show)
returns the OS's string form of the "error_to_show".
virtual ~critical_events()
static void FL_deadly_error(const char *file, int line, const char *classname, const char *function_name, const char *info)
Prints out an error message and then exits the program.
static void make_error_message(const char *file, int line, const char *error_class, const char *error_function, const char *info, char *guards_message_space)
Used to build our particular type of error message.
static void alert_message(const char *info, const char *title="Alert Message")
shows the message in "info", with an optional "title" on the message.
static void write_to_console(const char *message)
Prints out a message to the standard error file stream.
static basis::un_int system_error()
gets the most recent system error reported on this thread.
static void FL_continuable_error(const char *file, int line, const char *classname, const char *function_name, const char *info, const char *title)
Describes an error like deadly_error, but does not exit the program.
unsigned int un_int
Abbreviated name for unsigned integers.
A logger that sends to the console screen using the standard output device.