feisty meow concerns codebase 2.140
loggers::critical_events Class Reference

Provides a means of logging events for runtime problems. More...

#include <critical_events.h>

Inheritance diagram for loggers::critical_events:
Collaboration diagram for loggers::critical_events:

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.
 

Detailed Description

Provides a means of logging events for runtime problems.

Definition at line 96 of file critical_events.h.

Constructor & Destructor Documentation

◆ ~critical_events()

virtual loggers::critical_events::~critical_events ( )
inlinevirtual

Definition at line 99 of file critical_events.h.

Member Function Documentation

◆ alert_message() [1/3]

void loggers::critical_events::alert_message ( const basis::astring info)
static

Definition at line 149 of file critical_events.cpp.

References alert_message(), and basis::astring::s().

◆ alert_message() [2/3]

void loggers::critical_events::alert_message ( const basis::astring info,
const basis::astring title 
)
static

Definition at line 151 of file critical_events.cpp.

References alert_message(), and basis::astring::s().

◆ alert_message() [3/3]

void loggers::critical_events::alert_message ( const char *  info,
const char *  title = "Alert Message" 
)
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().

◆ critical_events_directory()

astring loggers::critical_events::critical_events_directory ( )
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().

◆ FL_console_error()

void loggers::critical_events::FL_console_error ( const char *  file,
int  line,
const char *  error_class,
const char *  error_function,
const char *  info 
)
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().

◆ FL_continuable_error() [1/2]

void loggers::critical_events::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 
)
static

A version using astring instead of char pointers.

Definition at line 230 of file critical_events.cpp.

References basis::astring::s().

◆ FL_continuable_error() [2/2]

void loggers::critical_events::FL_continuable_error ( const char *  file,
int  line,
const char *  classname,
const char *  function_name,
const char *  info,
const char *  title 
)
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().

◆ FL_deadly_error() [1/2]

void loggers::critical_events::FL_deadly_error ( const basis::astring file,
int  line,
const basis::astring classname,
const basis::astring function_name,
const basis::astring info 
)
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().

◆ FL_deadly_error() [2/2]

void loggers::critical_events::FL_deadly_error ( const char *  file,
int  line,
const char *  classname,
const char *  function_name,
const char *  info 
)
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().

◆ FL_non_continuable_error() [1/2]

void loggers::critical_events::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 
)
static

A version using astring instead of char pointers.

Definition at line 247 of file critical_events.cpp.

References basis::astring::s().

◆ FL_non_continuable_error() [2/2]

void loggers::critical_events::FL_non_continuable_error ( const char *  file,
int  line,
const char *  classname,
const char *  function_name,
const char *  info,
const char *  title 
)
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().

◆ FL_out_of_memory_now()

void loggers::critical_events::FL_out_of_memory_now ( const char *  file,
int  line,
const char *  classname,
const char *  function_name 
)
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().

◆ implement_bounds_halt()

void loggers::critical_events::implement_bounds_halt ( const char *  the_class_name,
const char *  func,
const char *  value,
const char *  low,
const char *  high,
const char *  error_addition 
)
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.

◆ make_error_message()

void loggers::critical_events::make_error_message ( const char *  file,
int  line,
const char *  error_class,
const char *  error_function,
const char *  info,
char *  guards_message_space 
)
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().

◆ set_critical_events_directory()

void loggers::critical_events::set_critical_events_directory ( const basis::astring directory)
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().

◆ system_error()

◆ system_error_text()

◆ write_to_console()

void loggers::critical_events::write_to_console ( const char *  message)
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().

◆ write_to_critical_events()

void loggers::critical_events::write_to_critical_events ( const char *  message)
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().


The documentation for this class was generated from the following files: