feisty meow concerns codebase
2.140
|
Provides a means of logging events for runtime problems. More...
#include <critical_events.h>
Public Member Functions | |
virtual | ~critical_events () |
Static Public Member Functions | |
static basis::un_int | system_error () |
gets the most recent system error reported on this thread. More... | |
static basis::astring | system_error_text (basis::un_int error_to_show) |
returns the OS's string form of the "error_to_show". More... | |
static void | write_to_console (const char *message) |
Prints out a message to the standard error file stream. More... | |
static void | alert_message (const char *info, const char *title="Alert Message") |
shows the message in "info", with an optional "title" on the message. More... | |
static void | alert_message (const basis::astring &info) |
static void | alert_message (const basis::astring &info, const basis::astring &title) |
static void | write_to_critical_events (const char *message) |
sends the "message" to the critical events log file. More... | |
static void | set_critical_events_directory (const basis::astring &directory) |
sets the internal location where the critical events will be logged. More... | |
static basis::astring | critical_events_directory () |
returns the current location where critical events are written. More... | |
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. More... | |
static void | FL_deadly_error (const basis::astring &file, int line, const basis::astring &classname, const basis::astring &function_name, const basis::astring &info) |
A version that takes strings instead of char pointers. More... | |
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. More... | |
static void | FL_continuable_error (const basis::astring &file, int line, const basis::astring &classname, const basis::astring &function_name, const basis::astring &info, const basis::astring &title) |
A version using astring instead of char pointers. More... | |
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. More... | |
static void | FL_non_continuable_error (const basis::astring &file, int line, const basis::astring &classname, const basis::astring &function_name, const basis::astring &info, const basis::astring &title) |
A version using astring instead of char pointers. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Provides a means of logging events for runtime problems.
Definition at line 96 of file critical_events.h.
|
inlinevirtual |
Definition at line 99 of file critical_events.h.
|
static |
Definition at line 147 of file critical_events.cpp.
References basis::astring::s().
|
static |
Definition at line 149 of file critical_events.cpp.
References basis::astring::s().
|
static |
shows the message in "info", with an optional "title" on the message.
the message is sent to the program wide logger, if one is expected to exist in this program.
Definition at line 125 of file critical_events.cpp.
References NULL_POINTER.
|
static |
returns the current location where critical events are written.
Definition at line 88 of file critical_events.cpp.
References loggers::default_critical_location().
|
static |
Prints out an error message to the standard error file stream.
Definition at line 246 of file critical_events.cpp.
References MESSAGE_SPACE_PROVIDED.
|
static |
A version using astring instead of char pointers.
Definition at line 220 of file critical_events.cpp.
References basis::astring::s().
|
static |
Describes an error like deadly_error, but does not exit the program.
Definition at line 213 of file critical_events.cpp.
|
static |
A version that takes strings instead of char pointers.
Definition at line 189 of file critical_events.cpp.
References basis::astring::s().
|
static |
Prints out an error message and then exits the program.
The parameters describe the location where the error was detected. This call should only be used in test programs or where absolutely necessary because it causes an almost immediate exit from the program! deadly_error should be reserved for when the program absolutely has to exit right then, because this function will actually enforce a crash / abort / break into debugger action rather than just calling exit().
Definition at line 177 of file critical_events.cpp.
References CAUSE_BREAKPOINT.
|
static |
A version using astring instead of char pointers.
Definition at line 237 of file critical_events.cpp.
References basis::astring::s().
|
static |
Shows the same information as continuable_error, but causes an exit.
This is a friendlier program exit than deadly_error. This version can be used when the program must stop, possibly because of a precondition failure or a problem in input data or basically whatever. it is not intended to abort or break into the debugger, but to simply exit().
Definition at line 228 of file critical_events.cpp.
|
static |
Causes the program to exit due to a memory allocation failure.
Definition at line 255 of file critical_events.cpp.
|
static |
Provides the real implementation of bounds_halt to save code space.
Definition at line 263 of file critical_events.cpp.
References continuable_error, and deadly_error.
|
static |
Used to build our particular type of error message.
It writes an error message into "guards_message_space" using our stylized object::method formatting.
Definition at line 152 of file critical_events.cpp.
|
static |
sets the internal location where the critical events will be logged.
this is postponed to a higher level, although the default will work too.
Definition at line 101 of file critical_events.cpp.
|
static |
gets the most recent system error reported on this thread.
Definition at line 53 of file critical_events.cpp.
|
static |
returns the OS's string form of the "error_to_show".
this often comes from the value reported by system_error().
Definition at line 65 of file critical_events.cpp.
|
static |
Prints out a message to the standard error file stream.
Definition at line 122 of file critical_events.cpp.
|
static |
sends the "message" to the critical events log file.
Prints out a message to the specially named file that captures all serious events written to error logging functions. If you use the functions in this file, you are likely already writing to this log.
Definition at line 104 of file critical_events.cpp.
References basis::astring::end(), basis::astring::find(), basis::non_negative(), basis::astring::s(), and basis::astring::zap().