#include "object_base.h"#include "program_wide_logger.h"#include "utility.h"Include dependency graph for log_base.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Classes | |
| class | log_base |
| Provides an abstract base for logging mechanisms. More... | |
Defines | |
| #define | FILTER_LOG(the_logger, to_log, filter) |
| Logs a string "to_log" on "the_logger" using the "filter". | |
| #define | EMERGENCY_LOG(the_logger, to_log) FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| Logs a string at the emergency level, meaning that it always gets logged. | |
| #define | STAMPED_FILTER_LOG(the_logger, to_log, filter) |
| Corresponding functions for including the time and date in the log entry. | |
| #define | STAMPED_EMERGENCY_LOG(the_logger, to_log) STAMPED_FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| Time-stamped logging that will always be printed. | |
| #define | CLASS_FILTER_LOG(the_logger, to_log, filter) |
| Class specific logging method that uses a filter. | |
| #define | CLASS_EMERGENCY_LOG(the_logger, to_log) CLASS_FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| Class specific logging method that always prints. | |
| #define | INSTANCE_FILTER_LOG(the_logger, to_log, filter) |
| Logs information that includes specific class instance information. | |
| #define | INSTANCE_EMERGENCY_LOG(the_logger, to_log) INSTANCE_FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| Logs with class instance info, but this always prints. | |
| #define CLASS_EMERGENCY_LOG | ( | the_logger, | |||
| to_log | ) | CLASS_FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| #define CLASS_FILTER_LOG | ( | the_logger, | |||
| to_log, | |||||
| filter | ) |
Value:
{ \
update_current_stack_frame_line_number(__LINE__); \
if (the_logger.member(filter)) { \
istring temp_log = to_log; \
if (temp_log.length()) { \
temp_log.insert(0, utility::timestamp(true, true)); \
BASE_FUNCTION(func); \
temp_log += " ["; \
temp_log += function_name; \
temp_log += "]"; \
} \
the_logger.log(temp_log, filter); \
} \
update_current_stack_frame_line_number(__LINE__); \
}
Definition at line 182 of file log_base.h.
| #define EMERGENCY_LOG | ( | the_logger, | |||
| to_log | ) | FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
Logs a string at the emergency level, meaning that it always gets logged.
Definition at line 164 of file log_base.h.
Referenced by connection_table::complain_missing_connection().
| #define FILTER_LOG | ( | the_logger, | |||
| to_log, | |||||
| filter | ) |
Value:
{ \
if (the_logger.member(filter)) { \
the_logger.log(to_log, filter); \
} \
}
The filter is checked before the string is allowed to come into existence, which saves allocations when the item would never be printed out anyway.
Definition at line 157 of file log_base.h.
| #define INSTANCE_EMERGENCY_LOG | ( | the_logger, | |||
| to_log | ) | INSTANCE_FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| #define INSTANCE_FILTER_LOG | ( | the_logger, | |||
| to_log, | |||||
| filter | ) |
Value:
{ \
update_current_stack_frame_line_number(__LINE__); \
if (the_logger.member(filter)) { \
istring temp_log = to_log; \
if (temp_log.length()) { \
temp_log.insert(0, utility::timestamp(true, true)); \
BASE_INSTANCE_FUNCTION(func); \
temp_log += " ["; \
temp_log += function_name; \
temp_log += "]"; \
} \
the_logger.log(temp_log, filter); \
update_current_stack_frame_line_number(__LINE__); \
} \
}
This use the instance name of the object, which can include more information than the simple class name.
Definition at line 204 of file log_base.h.
| #define STAMPED_EMERGENCY_LOG | ( | the_logger, | |||
| to_log | ) | STAMPED_FILTER_LOG(the_logger, to_log, log_base::ALWAYS_PRINT) |
| #define STAMPED_FILTER_LOG | ( | the_logger, | |||
| to_log, | |||||
| filter | ) |
Value:
{ \
if (the_logger.member(filter)) { \
istring temp_log = to_log; \
if (temp_log.length()) \
temp_log.insert(0, utility::timestamp(true, true)); \
the_logger.log(temp_log, filter); \
} \
}
Definition at line 168 of file log_base.h.
1.5.1