|
Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
|
#include <logger.h>
Public Slots | |
| void | RemoteLog (REMOTE_LOG_ENTRY LogEntry) |
| Receiver a Log Entry via a Public Slot. | |
Signals | |
| void | CountChanged (int counter) |
| A Signal to flag a change in the Number of Log Lines. | |
Public Member Functions | |
| Logger (Ui::MainWindow *UI_Window) | |
| The Log Constructor. | |
| ~Logger () | |
| The Log Destructor. | |
| void | Add (LOGGING_SEVERITY Severity, LOGGING_MODE Mode, const QString LogMessage) |
| Add a Line to Log (in it matches the current settings) | |
| void | SaveSeverityMask (int SeverityMask) |
| Save the Log Severity Mask. | |
| void | SaveModeMask (int ModeMask) |
| Save the Log Mode Mask. | |
| void | SetMaxLines (int MaxLogLines) |
| Set the maximum number of lines the log will retain. | |
Private Slots | |
| void | UpdateMaxLogLines (int Value) |
| void | LogSelectItem (QListWidgetItem *Item) |
| void | SaveLog (void) |
| Save the Log Lines to a File. | |
| void | ClearLog (void) |
| Clear the lines from the Log. | |
| void | LogItemsUnhide (void) |
| void | ReadSeverityMask (bool Unused) |
| Set the Severity Mask, based on window buttons. | |
| void | ReadModeMask (bool Unused) |
| Set the Mode Mask, based on window buttons. | |
| void | LogModeAll (void) |
| Turn All Modes On. | |
| void | LogModeNone (void) |
| Turn All Modes Off. | |
| void | LogSeverityAll (void) |
| Turn All Severities On. | |
| void | LogSeverityNone (void) |
| Turn All Severities Off. | |
Private Member Functions | |
| void | SaveLogSettings (void) |
| void | LoadLogSettings (void) |
| void | PresetLogSeverity (bool OnOff) |
| Preset all of the Log Severity Levels. | |
| void | PresetLogMode (bool OnOff) |
| Preset all of the Modes. | |
Private Attributes | |
| Ui::MainWindow * | ui |
| Pointer the Main Program Window. | |
| QStringList | severity_name_list |
| This list holds the names of the valid severity levels. | |
| QStringList | mode_name_list |
| This list holds the names of the valid modes. | |
| QStringList | icon_name_list |
| This list holds the names of the severity level icons. | |
| int | current_severity_mask |
| Mask holding currently active severity levels. | |
| int | current_mode_mask |
| Mask holding currently active modes. | |
| int | maximum_log_lines |
| The maximum number of lines the log will retain. | |
|
explicit |
The Log Constructor.
| UI_Window | The Program's main Window |
Definition at line 3 of file logger.cpp.
References current_mode_mask, current_severity_mask, DEFAULT_MAXIMUM_LOG_LINES, icon_name_list, LoadLogSettings(), LOG_DEBUG, maximum_log_lines, mode_name_list, MODE_SENSOR, severity_name_list, and ui.
| Logger::~Logger | ( | ) |
The Log Destructor.
Definition at line 30 of file logger.cpp.
References icon_name_list, mode_name_list, SaveLogSettings(), severity_name_list, and ui.
| void Logger::Add | ( | LOGGING_SEVERITY | Severity, |
| LOGGING_MODE | Mode, | ||
| const QString | LogMessage ) |
Add a Line to Log (in it matches the current settings)
| Severity | The Severtiry Level of the event being reported |
| Mode | The Logging Mode (event type) of the event being reported |
| LogMessage | Text message describing the event |
If the Severity and Mode match the enable severity and mode in the log, this will be added to the log with a time stamp. If it does not meet these criteria, the line will be quietly ignored.
Definition at line 136 of file logger.cpp.
References CountChanged(), current_mode_mask, current_severity_mask, icon_name_list, maximum_log_lines, mode_name_list, severity_name_list, and ui.
Referenced by PresetLogMode(), PresetLogSeverity(), and RemoteLog().
|
privateslot |
Clear the lines from the Log.
This routine will delete all of the lines that the log current holds.
Definition at line 53 of file logger.cpp.
References CountChanged(), and ui.
Referenced by LoadLogSettings().
|
signal |
A Signal to flag a change in the Number of Log Lines.
| counter | The new Number of Log Lines |
When the number of log lones is increased (or decreased), this signal is fired so that the number of log lines display can be updated.
Referenced by Add(), ClearLog(), LoadLogSettings(), and SaveLog().
|
private |
Definition at line 166 of file logger.cpp.
References ClearLog(), CountChanged(), LogItemsUnhide(), LogModeAll(), LogModeNone(), LogSelectItem(), LogSeverityAll(), LogSeverityNone(), ReadModeMask(), ReadSeverityMask(), SaveLog(), ui, and UpdateMaxLogLines().
Referenced by Logger().
|
privateslot |
Definition at line 498 of file logger.cpp.
References ui.
Referenced by LoadLogSettings().
|
privateslot |
Turn All Modes On.
This routine turns all Modes on to make it easy to set the active modes without checking a lot of check boxes.
Definition at line 478 of file logger.cpp.
References PresetLogMode().
Referenced by LoadLogSettings().
|
privateslot |
Turn All Modes Off.
This routine turns all Modes off to make it easy to reset the active modes without checking a lot of check boxes.
Definition at line 483 of file logger.cpp.
References PresetLogMode().
Referenced by LoadLogSettings().
|
privateslot |
Definition at line 469 of file logger.cpp.
References ui.
Referenced by LoadLogSettings().
|
privateslot |
Turn All Severities On.
This routine turns all Severities on to make it easy to set the active Severities without checking a lot of check boxes.
Definition at line 488 of file logger.cpp.
References PresetLogSeverity().
Referenced by LoadLogSettings().
|
privateslot |
Turn All Severities Off.
This routine turns all Severities off to make it easy to reset the active Severities without checking a lot of check boxes.
Definition at line 493 of file logger.cpp.
References PresetLogSeverity().
Referenced by LoadLogSettings().
|
private |
Preset all of the Modes.
| OnOff |
If OnOff is On, all modes will be set, otherwise, all will be reset.
Definition at line 106 of file logger.cpp.
References Add(), LOG_DEBUG, MODE_OPERATOR, SaveModeMask(), and ui.
Referenced by LogModeAll(), and LogModeNone().
|
private |
Preset all of the Log Severity Levels.
| OnOff |
If OnOff is On, all severity levels will be set, otherwise, all will be reset.
Definition at line 84 of file logger.cpp.
References Add(), LOG_DEBUG, MODE_OPERATOR, SaveSeverityMask(), and ui.
Referenced by LogSeverityAll(), and LogSeverityNone().
|
privateslot |
Set the Mode Mask, based on window buttons.
| Unused | parameter for Signal, Slot parameter matching |
This routine will look at the state of the Mode buttons associated with the logger and sets the bits in the serverity mask corresponding to the set buttons.
Definition at line 320 of file logger.cpp.
References MODE_CONFIG, MODE_DATABASE, MODE_EXCEPTION, MODE_FILE, MODE_GENERAL, MODE_GRAPHICS, MODE_MATHS, MODE_MEMORY, MODE_NETWORK, MODE_OPERATOR, MODE_QT, MODE_SECURITY, MODE_SENSOR, MODE_SIG_PROC, MODE_THREAD, MODE_TIMING, SaveModeMask(), and ui.
Referenced by LoadLogSettings().
|
privateslot |
Set the Severity Mask, based on window buttons.
| Unused | parameter for Signal, Slot parameter matching |
This routine will look at the state of the Serverity buttons associated with the logger and sets the bits in the serverity mask corresponding to the set buttons.
Definition at line 242 of file logger.cpp.
References LOG_ALERT, LOG_CRITICAL, LOG_DEBUG, LOG_EMERGENCY, LOG_ERROR, LOG_INFO, LOG_NOTICE, LOG_WARNING, SaveSeverityMask(), and ui.
Referenced by LoadLogSettings().
|
slot |
Receiver a Log Entry via a Public Slot.
| LogEntry | Structure holding the Log Entry |
Definition at line 554 of file logger.cpp.
References Add(), REMOTE_LOG_ENTRY::Message, REMOTE_LOG_ENTRY::Mode, and REMOTE_LOG_ENTRY::Severity.
|
privateslot |
Save the Log Lines to a File.
This routine takes the lines in the log and writes them to a file.
Definition at line 59 of file logger.cpp.
References CountChanged(), and ui.
Referenced by LoadLogSettings().
|
private |
Definition at line 515 of file logger.cpp.
References ui.
Referenced by ~Logger().
| void Logger::SaveModeMask | ( | int | ModeMask | ) |
Save the Log Mode Mask.
| ModeMask | A mask of the active modes |
The SeverityMask holds each possible mode as a bit mask. If a bit is on, then that mode is active.
Definition at line 43 of file logger.cpp.
References current_mode_mask.
Referenced by PresetLogMode(), and ReadModeMask().
| void Logger::SaveSeverityMask | ( | int | SeverityMask | ) |
Save the Log Severity Mask.
| SeverityMask | A mask of the active severity levels |
The SeverityMask holds each possible severity level as a bit mask. If a bit is on, then that severity level is active.
Definition at line 38 of file logger.cpp.
References current_severity_mask.
Referenced by PresetLogSeverity(), and ReadSeverityMask().
| void Logger::SetMaxLines | ( | int | MaxLogLines | ) |
Set the maximum number of lines the log will retain.
| MaxLogLines | Maximum log lines to retain |
This function sets the maximum number of lines the log will retain before the oldest lines are delted when a new log line arrives.
Definition at line 48 of file logger.cpp.
References maximum_log_lines.
Referenced by UpdateMaxLogLines().
|
privateslot |
Definition at line 510 of file logger.cpp.
References SetMaxLines().
Referenced by LoadLogSettings().
|
private |
Mask holding currently active modes.
Each mode is represented by a bit in the mask. If that bit is not a 1, then a log message with that mode will be rejected.
Definition at line 220 of file logger.h.
Referenced by Add(), Logger(), and SaveModeMask().
|
private |
Mask holding currently active severity levels.
Each severity level is represented by a bit in the mask. If that bit is not a 1, then a log message with that level will be rejected.
Definition at line 212 of file logger.h.
Referenced by Add(), Logger(), and SaveSeverityMask().
|
private |
This list holds the names of the severity level icons.
These icons are attached to the log lines that are placed in the log. The colour is an indication of the severity level of the log line. The icon colours range from deep green for Debug, through to deep red for a fatal error.
|
private |
The maximum number of lines the log will retain.
Definition at line 226 of file logger.h.
Referenced by Add(), Logger(), and SetMaxLines().
|
private |
|
private |
|
private |
Pointer the Main Program Window.
This is used to access all the graphical objects on the display.
Definition at line 183 of file logger.h.
Referenced by Add(), ClearLog(), LoadLogSettings(), Logger(), LogItemsUnhide(), LogSelectItem(), PresetLogMode(), PresetLogSeverity(), ReadModeMask(), ReadSeverityMask(), SaveLog(), SaveLogSettings(), and ~Logger().