|
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. | |
| static basis::astring | system_error_text (basis::un_int error_to_show) |
| returns the OS's string form of the "error_to_show". | |
| static void | write_to_console (const char *message) |
| Prints out a message to the standard error file stream. | |
| 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 | 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. | |
| static void | set_critical_events_directory (const basis::astring &directory) |
| sets the internal location where the critical events will be logged. | |
| static basis::astring | critical_events_directory () |
| returns the current location where critical events are written. | |
| 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 | 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. | |
| 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. | |
| 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. | |
| 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 | 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. | |
| 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 | 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 | 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 | 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. | |
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 149 of file critical_events.cpp.
References alert_message(), and basis::astring::s().
|
static |
Definition at line 151 of file critical_events.cpp.
References alert_message(), and 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 127 of file critical_events.cpp.
References loggers::program_wide_logger::get(), basis::base_logger::log(), NULL_POINTER, and textual::parser_bits::platform_eol_to_chars().
Referenced by alert_message(), alert_message(), main(), main(), and versions::version_ini::one_stop_version_stamp().
|
static |
returns the current location where critical events are written.
Definition at line 90 of file critical_events.cpp.
References loggers::default_critical_location(), and set_critical_events_directory().
Referenced by write_to_critical_events().
|
static |
Prints out an error message to the standard error file stream.
Definition at line 256 of file critical_events.cpp.
References make_error_message(), MESSAGE_SPACE_PROVIDED, and write_to_console().
|
static |
A version using astring instead of char pointers.
Definition at line 230 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 223 of file critical_events.cpp.
Referenced by FL_deadly_error().
|
static |
A version that takes strings instead of char pointers.
Definition at line 193 of file critical_events.cpp.
References FL_deadly_error(), and 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 180 of file critical_events.cpp.
References CAUSE_BREAKPOINT, and FL_continuable_error().
Referenced by FL_deadly_error().
|
static |
A version using astring instead of char pointers.
Definition at line 247 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 238 of file critical_events.cpp.
Referenced by FL_out_of_memory_now().
|
static |
Causes the program to exit due to a memory allocation failure.
Definition at line 265 of file critical_events.cpp.
References FL_non_continuable_error().
|
static |
Provides the real implementation of bounds_halt to save code space.
Definition at line 273 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 154 of file critical_events.cpp.
References timely::time_stamp::notarize().
Referenced by FL_console_error().
|
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 103 of file critical_events.cpp.
Referenced by critical_events_directory().
|
static |
gets the most recent system error reported on this thread.
Definition at line 55 of file critical_events.cpp.
Referenced by sockets::spocket::accept(), sockets::spocket::connect(), sockets::tcpip_stack::full_resolve(), sockets::tcpip_stack::hostname(), sockets::socket_minder::push_receives(), sockets::socket_minder::push_sends(), sockets::spocket::receive(), sockets::spocket::receive_from(), processes::launch_process::run(), sockets::raw_socket::select(), sockets::spocket::send(), sockets::spocket::send_to(), application::shared_memory::shared_memory(), and processes::process_control::zap_process().
|
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 67 of file critical_events.cpp.
Referenced by sockets::spocket::accept(), sockets::spocket::connect(), broadcast_spocket_tester::do_a_receive(), spocket_tester::do_a_receive(), application::launch_manager::launch_now(), sockets::spocket::receive(), sockets::spocket::receive_from(), processes::launch_process::run(), sockets::spocket::send(), application::shared_memory::shared_memory(), processes::ethread::start(), sockets::tcpip_stack::tcpip_error_name(), and processes::process_control::zap_process().
|
static |
Prints out a message to the standard error file stream.
Definition at line 124 of file critical_events.cpp.
Referenced by FL_console_error().
|
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 106 of file critical_events.cpp.
References configuration::application_configuration::application_name(), critical_events_directory(), basis::astring::end(), basis::astring::find(), basis::non_negative(), timely::time_stamp::notarize(), textual::parser_bits::platform_eol_to_chars(), basis::astring::s(), and basis::astring::zap().