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. 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...
 

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 147 of file critical_events.cpp.

References 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 149 of file critical_events.cpp.

References 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 125 of file critical_events.cpp.

References NULL_POINTER.

◆ critical_events_directory()

astring loggers::critical_events::critical_events_directory ( )
static

returns the current location where critical events are written.

Definition at line 88 of file critical_events.cpp.

References loggers::default_critical_location().

◆ 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 246 of file critical_events.cpp.

References MESSAGE_SPACE_PROVIDED.

◆ 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 220 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 213 of file critical_events.cpp.

◆ 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 189 of file critical_events.cpp.

References 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 177 of file critical_events.cpp.

References CAUSE_BREAKPOINT.

◆ 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 237 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 228 of file critical_events.cpp.

◆ 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 255 of file critical_events.cpp.

◆ 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 263 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 152 of file critical_events.cpp.

◆ 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 101 of file critical_events.cpp.

◆ system_error()

basis::un_int loggers::critical_events::system_error ( )
static

gets the most recent system error reported on this thread.

Definition at line 53 of file critical_events.cpp.

◆ system_error_text()

astring loggers::critical_events::system_error_text ( basis::un_int  error_to_show)
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.

◆ 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 122 of file critical_events.cpp.

◆ 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 104 of file critical_events.cpp.

References basis::astring::end(), basis::astring::find(), basis::non_negative(), basis::astring::s(), and basis::astring::zap().


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