Project Documentation Manager BRIGADOON-0002
Project Documentation Manager
Loading...
Searching...
No Matches
logger.cpp
Go to the documentation of this file.
1#include "logger.h"
2
3Logger::Logger(Ui::MainWindow* UI_Window)
4{
5 // Keep a Pointer to the Main Window
6 ui = UI_Window;
7
8 // Register Custom Meta Types for the "QObject::connect" Definitions
9 qRegisterMetaType<REMOTE_LOG_ENTRY>("REMOTE_LOG_ENTRY");
10
11 // Setup Severity Names
12 severity_name_list << "EMERGENCY" << "ALERT" << "CRITICAL" << "ERROR"
13 << "WARNING" << "NOTICE" << "INFO" << "DEBUG";
14
15 // Setup Severity Icon List
16 icon_name_list << ":/Resources/Emergency.png" << ":/Resources/Alert.png" << ":/Resources/Critical.png" << ":/Resources/Error.png"
17 << ":/Resources/Warning.png" << ":/Resources/Notice.png" << ":/Resources/Info.png" << ":/Resources/Debug.png";
18
19 // Setup Mode Names
20 mode_name_list << "SIG_PROC" << "QT" << "GENERAL" << "THREAD" << "CONFIG" << "TIMING" << "SECURITY" << "GRAPHICS"
21 << "MEMORY" << "MATHS" << "FILE" << "NETWORK" << "OPERATOR" << "DATABASE" << "EXCEPTION" << "SENSOR";
22
23 current_severity_mask = ( 1 << (LOG_DEBUG + 1 ) ) - 1;
24 current_mode_mask = ( 1 << (MODE_SENSOR + 1 ) ) - 1;
26
28}
29
31{
32 if (ui->LogSavOnExit->isChecked()) SaveLogSettings();
33 severity_name_list.clear();
34 icon_name_list.clear();
35 mode_name_list.clear();
36}
37
38void Logger::SaveSeverityMask( int SeverityMask )
39{
40 current_severity_mask = SeverityMask;
41}
42
43void Logger::SaveModeMask( int ModeMask )
44{
45 current_mode_mask = ModeMask;
46}
47
48void Logger::SetMaxLines( int MaxLogLines )
49{
50 maximum_log_lines = MaxLogLines;
51}
52
53void Logger::ClearLog( void )
54{
55 ui->LogView->clear();
56 emit CountChanged( ui->LogView->count() );
57}
58
59void Logger::SaveLog( void )
60{
61 // Ask the User for the Name of the File to hold the Log Entries
62 QString filename = QFileDialog::getSaveFileName( nullptr, "Save Filename", "LogFile.txt", "Files (*.txt )" );
63
64 // If A Filename was provided, write out the log lines, then clear the display.
65 if ( filename != "" )
66 {
67 // Write to the File
68 QFile file( filename );
69 if (file.open(QIODevice::WriteOnly | QIODevice::Text))
70 {
71 int row_counter = 0;
72 QTextStream out(&file);
73 while( row_counter < ui->LogView->count() )
74 {
75 out << ui->LogView->item( row_counter++ )->text() << "\n";
76 }
77 }
78 file.close();
79 ui->LogView->clear();
80 }
81 emit CountChanged( ui->LogView->count() );
82}
83
84void Logger::PresetLogSeverity( bool OnOff )
85{
86 ui->EmergencySelect->setChecked( OnOff );
87 ui->AlertSelect->setChecked( OnOff );
88 ui->DebugSelect->setChecked( OnOff );
89 ui->ErrorSelect->setChecked( OnOff );
90 ui->NoticeSelect->setChecked( OnOff );
91 ui->WarningSelect->setChecked( OnOff );
92 ui->CriticalSelect->setChecked( OnOff );
93 ui->InfoSelect->setChecked( OnOff );
94 SaveSeverityMask( true );
95
96 if ( OnOff )
97 {
98 Add( LOG_DEBUG, MODE_OPERATOR, "All Severity Check Boxes Enabled" );
99 }
100 else
101 {
102 Add( LOG_DEBUG, MODE_OPERATOR, "All Severity Check Boxes Disabled" );
103 }
104}
105
106void Logger::PresetLogMode( bool OnOff )
107{
108 ui->SigProcessSelect->setChecked( OnOff );
109 ui->QtSelect->setChecked( OnOff );
110 ui->GeneralSelect->setChecked( OnOff );
111 ui->ThreadSelect->setChecked( OnOff );
112 ui->ConfigSelect->setChecked( OnOff );
113 ui->TimingSelect->setChecked( OnOff );
114 ui->SecuritySelect->setChecked( OnOff );
115 ui->GraphicsSelect->setChecked( OnOff );
116 ui->MemorySelect->setChecked( OnOff );
117 ui->MathsSelect->setChecked( OnOff );
118 ui->FileOpsSelect ->setChecked( OnOff );
119 ui->NetworkCommsSelect->setChecked( OnOff );
120 ui->OperatorSelect->setChecked( OnOff );
121 ui->DatabaseSelect->setChecked( OnOff );
122 ui->ExceptionsSelect->setChecked( OnOff );
123 ui->SensorsSelect->setChecked( OnOff );
124 SaveModeMask( true );
125
126 if ( OnOff )
127 {
128 Add( LOG_DEBUG, MODE_OPERATOR, "All Mode Check Boxes Enabled" );
129 }
130 else
131 {
132 Add( LOG_DEBUG, MODE_OPERATOR, "All Mode Check Boxes Disabled" );
133 }
134}
135
136void Logger::Add( LOGGING_SEVERITY Severity, LOGGING_MODE Mode, const QString LogMessage )
137{
138 // Check if the Log message will be added to the Log record based onthe Severity and Mode
139 if ( ( ( current_severity_mask & (1 << Severity ) ) != 0 ) && ( ( current_mode_mask & (1 << Mode ) ) != 0 ) )
140 {
141 // Get the name of the severity icon, the name of the severity level, the name of the mode and the datetime of the entry
142 // and place it into a ListWidget Item for inclusion in the Log
143 QString icon_name = icon_name_list.at( Severity );
144 QString severity_name = severity_name_list.at( Severity );
145 QString mode_name = mode_name_list.at( Mode );
146 QString entry_date = QDateTime::currentDateTime().toString();
147 QString log_entry = "<" + entry_date + ">[" + severity_name + " : " + mode_name + " ] " +LogMessage;
148 QListWidgetItem *item = new QListWidgetItem;
149
150 // Put the Icon and Text into the Log Item and add to the Log
151 item->setIcon( QIcon( icon_name ) );
152 item->setText( log_entry );
153 ui->LogView->addItem( item );
154
155 // Remove Oldest Item While the Line Count Is Being Exceeded
156 while ( ui->LogView->count() > maximum_log_lines )
157 {
158 ui->LogView->takeItem( 0 );
159 }
160 }
161
162 // Flag the number of Entries in the Log to the Number of Log Lines Display
163 emit CountChanged( ui->LogView->count() );
164}
165
167{
168 QSettings settings( "brigadoon/netprojectmanager" );
169
170 // Load Log Setup Parameters
171 ui->MaxLogLines->setValue( settings.value( "Log_Setup/Allowed_lines", 500 ).toInt() );
172 ui->MaxLogLines->setMinimum( settings.value( "Log_Setup/Minimum_lines", 20 ).toInt() );
173 ui->MaxLogLines->setMaximum( settings.value( "Log_Setup/Maximum_lines", 20000 ).toInt() );
174
175 // Set the Connections
176 QObject::connect( ui->ModeSelectAll, SIGNAL( pressed( void ) ), this, SLOT( LogModeAll( void ) ) );
177 QObject::connect( ui->ModeClearAll, SIGNAL( pressed( void ) ), this, SLOT( LogModeNone( void ) ) );
178 QObject::connect( ui->SeveritySelectAll, SIGNAL( pressed( void ) ), this, SLOT( LogSeverityAll( void ) ) );
179 QObject::connect( ui->SeverityClearAll, SIGNAL( pressed( void ) ), this, SLOT( LogSeverityNone( void ) ) );
180 QObject::connect( ui->SaveLog, SIGNAL( pressed( void ) ), this, SLOT( SaveLog( void ) ) );
181 QObject::connect( ui->ClearLog, SIGNAL( pressed( void ) ), this, SLOT( ClearLog( void ) ) );
182 QObject::connect( ui->EmergencySelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
183 QObject::connect( ui->AlertSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
184 QObject::connect( ui->CriticalSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
185 QObject::connect( ui->ErrorSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
186 QObject::connect( ui->WarningSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
187 QObject::connect( ui->NoticeSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
188 QObject::connect( ui->InfoSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
189 QObject::connect( ui->DebugSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
190 QObject::connect( ui->SigProcessSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
191 QObject::connect( ui->QtSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
192 QObject::connect( ui->GeneralSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
193 QObject::connect( ui->ThreadSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
194 QObject::connect( ui->ConfigSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
195 QObject::connect( ui->TimingSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
196 QObject::connect( ui->SecuritySelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
197 QObject::connect( ui->GraphicsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
198 QObject::connect( ui->MemorySelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
199 QObject::connect( ui->MathsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
200 QObject::connect( ui->FileOpsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
201 QObject::connect( ui->NetworkCommsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
202 QObject::connect( ui->OperatorSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
203 QObject::connect( ui->DatabaseSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
204 QObject::connect( ui->ExceptionsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
205 QObject::connect( ui->SensorsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
206 QObject::connect( this, SIGNAL( CountChanged( int ) ), ui->LogLineCounter, SLOT( display( int ) ) );
207 QObject::connect( ui->LogView, SIGNAL( itemClicked( QListWidgetItem * ) ), this, SLOT( LogSelectItem( QListWidgetItem * ) ) );
208 QObject::connect( ui->AllUnhideLog, SIGNAL( pressed( void) ), this, SLOT( LogItemsUnhide( void ) ) );
209 QObject::connect( ui->MaxLogLines, SIGNAL( valueChanged( int) ), this, SLOT( UpdateMaxLogLines( int ) ) );
210
211 ui->EmergencySelect->setChecked( settings.value( "Log_Severity/Emergency", true ).toBool() );
212 ui->AlertSelect->setChecked( settings.value( "Log_Severity/Alert", true ).toBool() );
213 ui->CriticalSelect->setChecked( settings.value( "Log_Severity/Critical", true ).toBool() );
214 ui->ErrorSelect->setChecked( settings.value( "Log_Severity/Error", true ).toBool() );
215 ui->WarningSelect->setChecked( settings.value( "Log_Severity/Warning", true ).toBool() );
216 ui->NoticeSelect->setChecked( settings.value( "Log_Severity/Notice", true ).toBool() );
217 ui->InfoSelect->setChecked( settings.value( "Log_Severity/Info", true ).toBool() );
218 ui->DebugSelect->setChecked( settings.value( "Log_Severity/Debug", true ).toBool() );
219 ReadSeverityMask( true );
220
221 // Load the Mode Settings
222 ui->SigProcessSelect->setChecked( settings.value( "Log_Mode/SigProc", true ).toBool() );
223 ui->QtSelect->setChecked( settings.value( "Log_Mode/Qt", true ).toBool() );
224 ui->GeneralSelect->setChecked( settings.value( "Log_Mode/General", true ).toBool() );
225 ui->ThreadSelect->setChecked( settings.value( "Log_Mode/Thread", true ).toBool() );
226 ui->ConfigSelect->setChecked( settings.value( "Log_Mode/Configuration", true ).toBool() );
227 ui->TimingSelect->setChecked( settings.value( "Log_Mode/Timing", true ).toBool() );
228 ui->SecuritySelect->setChecked( settings.value( "Log_Mode/Security", true ).toBool() );
229 ui->GraphicsSelect->setChecked( settings.value( "Log_Mode/Graphics", true ).toBool() );
230 ui->MemorySelect->setChecked( settings.value( "Log_Mode/Memory", true ).toBool() );
231 ui->MathsSelect->setChecked( settings.value( "Log_Mode/Maths", true ).toBool() );
232 ui->FileOpsSelect->setChecked( settings.value( "Log_Mode/File", true ).toBool() );
233 ui->NetworkCommsSelect->setChecked( settings.value( "Log_Mode/Network", true ).toBool() );
234 ui->OperatorSelect->setChecked( settings.value( "Log_Mode/Operator", true ).toBool() );
235 ui->DatabaseSelect->setChecked( settings.value( "Log_Mode/Database", true ).toBool() );
236 ui->ExceptionsSelect->setChecked( settings.value( "Log_Mode/Exception", true ).toBool() );
237 ui->SensorsSelect->setChecked( settings.value( "Log_Mode/Sensors", true ).toBool() );
238 ReadModeMask( true );
239}
240
241// Read Severity Mask
242void Logger::ReadSeverityMask( bool Unused )
243{
244 int severity_mask = 0;
245
246 if ( ui->EmergencySelect->isChecked() )
247 {
248 severity_mask |= 1 << LOG_EMERGENCY;
249 }
250 else
251 {
252 severity_mask &= ~(1 << LOG_EMERGENCY);
253 }
254
255 if ( ui->AlertSelect->isChecked() )
256 {
257 severity_mask |= 1 << LOG_ALERT;
258 }
259 else
260 {
261 severity_mask &= ~(1 << LOG_ALERT);
262 }
263
264 if ( ui->CriticalSelect->isChecked() )
265 {
266 severity_mask |= 1 << LOG_CRITICAL;
267 }
268 else
269 {
270 severity_mask &= ~(1 << LOG_CRITICAL);
271 }
272
273 if ( ui->ErrorSelect->isChecked() )
274 {
275 severity_mask |= 1 << LOG_ERROR;
276 }
277 else
278 {
279 severity_mask &= ~(1 << LOG_ERROR);
280 }
281
282 if ( ui->WarningSelect->isChecked() )
283 {
284 severity_mask |= 1 << LOG_WARNING;
285 }
286 else
287 {
288 severity_mask &= ~(1 << LOG_WARNING);
289 }
290
291 if ( ui->NoticeSelect->isChecked() )
292 {
293 severity_mask |= 1 << LOG_NOTICE;
294 }
295 else
296 {
297 severity_mask &= ~(1 << LOG_NOTICE);
298 }
299
300 if ( ui->InfoSelect->isChecked() )
301 {
302 severity_mask |= 1 << LOG_INFO;
303 }
304 else
305 {
306 severity_mask &= ~(1 << LOG_INFO);
307 }
308
309 if ( ui->DebugSelect->isChecked() )
310 {
311 severity_mask |= 1 << LOG_DEBUG;
312 }
313 else
314 {
315 severity_mask &= ~(1 << LOG_DEBUG);
316 }
317 SaveSeverityMask( severity_mask );
318}
319
320void Logger::ReadModeMask( bool Unused )
321{
322 int mode_mask = 0;
323
324 if ( ui->SigProcessSelect->isChecked() )
325 {
326 mode_mask |= 1 << MODE_SIG_PROC;
327 }
328 else
329 {
330 mode_mask &= ~(1 << MODE_SIG_PROC);
331 }
332 if ( ui->QtSelect->isChecked() )
333 {
334 mode_mask |= 1 << MODE_QT;
335 }
336 else
337 {
338 mode_mask &= ~(1 << MODE_QT);
339 }
340
341 if ( ui->GeneralSelect->isChecked() )
342 {
343 mode_mask |= 1 << MODE_GENERAL;
344 }
345 else
346 {
347 mode_mask &= ~(1 << MODE_GENERAL);
348 }
349
350 if ( ui->ThreadSelect->isChecked() )
351 {
352 mode_mask |= 1 << MODE_THREAD;
353 }
354 else
355 {
356 mode_mask &= ~(1 << MODE_THREAD);
357 }
358
359 if ( ui->ConfigSelect->isChecked() )
360 {
361 mode_mask |= 1 << MODE_CONFIG;
362 }
363 else
364 {
365 mode_mask &= ~(1 << MODE_CONFIG);
366 }
367
368 if ( ui->TimingSelect->isChecked() )
369 {
370 mode_mask |= 1 << MODE_TIMING;
371 }
372 else
373 {
374 mode_mask &= ~(1 << MODE_TIMING);
375 }
376
377 if ( ui->SecuritySelect->isChecked() )
378 {
379 mode_mask |= 1 << MODE_SECURITY;
380 }
381 else
382 {
383 mode_mask &= ~(1 << MODE_SECURITY);
384 }
385
386 if ( ui->GraphicsSelect->isChecked() )
387 {
388 mode_mask |= 1 << MODE_GRAPHICS;
389 }
390 else
391 {
392 mode_mask &= ~(1 << MODE_GRAPHICS);
393 }
394
395 if ( ui->MemorySelect->isChecked() )
396 {
397 mode_mask |= 1 << MODE_MEMORY;
398 }
399 else
400 {
401 mode_mask &= ~(1 << MODE_MEMORY);
402 }
403
404 if ( ui->MathsSelect->isChecked() )
405 {
406 mode_mask |= 1 << MODE_MATHS;
407 }
408 else
409 {
410 mode_mask &= ~(1 << MODE_MATHS);
411 }
412
413 if ( ui->FileOpsSelect->isChecked() )
414 {
415 mode_mask |= 1 << MODE_FILE;
416 }
417 else
418 {
419 mode_mask &= ~(1 << MODE_FILE);
420 }
421
422 if ( ui->NetworkCommsSelect->isChecked() )
423 {
424 mode_mask |= 1 << MODE_NETWORK;
425 }
426 else
427 {
428 mode_mask &= ~(1 << MODE_NETWORK);
429 }
430
431 if ( ui->OperatorSelect->isChecked() )
432 {
433 mode_mask |= 1 << MODE_OPERATOR;
434 }
435 else
436 {
437 mode_mask &= ~(1 << MODE_OPERATOR);
438 }
439
440 if ( ui->DatabaseSelect->isChecked() )
441 {
442 mode_mask |= 1 << MODE_DATABASE;
443 }
444 else
445 {
446 mode_mask &= ~(1 << MODE_DATABASE);
447 }
448
449 if ( ui->ExceptionsSelect->isChecked() )
450 {
451 mode_mask |= 1 << MODE_EXCEPTION;
452 }
453 else
454 {
455 mode_mask &= ~(1 << MODE_EXCEPTION);
456 }
457
458 if ( ui->SensorsSelect->isChecked() )
459 {
460 mode_mask |= 1 << MODE_SENSOR;
461 }
462 else
463 {
464 mode_mask &= ~(1 << MODE_SENSOR);
465 }
466 SaveModeMask( mode_mask );
467}
468
469void Logger::LogSelectItem( QListWidgetItem * Item )
470{
471 // If Hidden Selected, Hide the Log Line
472 if ( ui->HideSelectedLog->isChecked() )
473 {
474 Item->setHidden( true );
475 }
476}
477
479{
480 PresetLogMode( true );
481}
482
484{
485 PresetLogMode( false );
486}
487
489{
490 PresetLogSeverity( true );
491}
492
494{
495 PresetLogSeverity( false );
496}
497
499{
500 for ( int row = 0; row < ui->LogView->count(); ++row )
501 {
502 QListWidgetItem *item = ui->LogView->item( row );
503 if ( item != nullptr )
504 {
505 item->setHidden( false );
506 }
507 }
508}
509
511{
512 SetMaxLines( Value );
513}
514
516{
517 QSettings settings( "brigadoon/netprojectmanager");
518
519 // Save the Log Severity Settings
520 settings.setValue( "Log_Severity/Emergency", ui->EmergencySelect->isChecked() );
521 settings.setValue( "Log_Severity/Alert", ui->AlertSelect->isChecked() );
522 settings.setValue( "Log_Severity/Critical", ui->CriticalSelect->isChecked() );
523 settings.setValue( "Log_Severity/Error", ui->ErrorSelect->isChecked() );
524 settings.setValue( "Log_Severity/Warning", ui->WarningSelect->isChecked() );
525 settings.setValue( "Log_Severity/Notice", ui->NoticeSelect->isChecked() );
526 settings.setValue( "Log_Severity/Info", ui->InfoSelect->isChecked() );
527 settings.setValue( "Log_Severity/Debug", ui->DebugSelect->isChecked() );
528
529
530 // Save the Mode Settings
531 settings.setValue( "Log_Mode/SigProc", ui->SigProcessSelect->isChecked() );
532 settings.setValue( "Log_Mode/Qt", ui->QtSelect->isChecked() );
533 settings.setValue( "Log_Mode/General", ui->GeneralSelect->isChecked() );
534 settings.setValue( "Log_Mode/Thread", ui->ThreadSelect->isChecked() );
535 settings.setValue( "Log_Mode/Configuration", ui->ConfigSelect->isChecked() );
536 settings.setValue( "Log_Mode/Timing", ui->TimingSelect->isChecked() );
537 settings.setValue( "Log_Mode/Security", ui->SecuritySelect->isChecked() );
538 settings.setValue( "Log_Mode/Graphics", ui->GraphicsSelect->isChecked() );
539 settings.setValue( "Log_Mode/Memory", ui->MemorySelect->isChecked() );
540 settings.setValue( "Log_Mode/Maths", ui->MathsSelect->isChecked() );
541 settings.setValue( "Log_Mode/File", ui->FileOpsSelect->isChecked() );
542 settings.setValue( "Log_Mode/Network", ui->NetworkCommsSelect->isChecked() );
543 settings.setValue( "Log_Mode/Operator", ui->OperatorSelect->isChecked() );
544 settings.setValue( "Log_Mode/Database", ui->DatabaseSelect->isChecked() );
545 settings.setValue( "Log_Mode/Exception", ui->ExceptionsSelect->isChecked() );
546 settings.setValue( "Log_Mode/Sensors", ui->SensorsSelect->isChecked() );
547
548 // Save Log Parameters
549 settings.setValue( "Log_Setup/Allowed_lines", ui->MaxLogLines->value() );
550 settings.setValue( "Log_Setup/Minimum_lines", ui->MaxLogLines->minimum() );
551 settings.setValue( "Log_Setup/Maximum_lines", ui->MaxLogLines->maximum() );
552}
553
555{
556 Add( LogEntry.Severity, LogEntry.Mode, LogEntry.Message );
557}
void UpdateMaxLogLines(int Value)
Definition logger.cpp:510
void SaveModeMask(int ModeMask)
Save the Log Mode Mask.
Definition logger.cpp:43
Ui::MainWindow * ui
Pointer the Main Program Window.
Definition logger.h:183
void CountChanged(int counter)
A Signal to flag a change in the Number of Log Lines.
void ClearLog(void)
Clear the lines from the Log.
Definition logger.cpp:53
int maximum_log_lines
The maximum number of lines the log will retain.
Definition logger.h:226
void LogModeNone(void)
Turn All Modes Off.
Definition logger.cpp:483
void Add(LOGGING_SEVERITY Severity, LOGGING_MODE Mode, const QString LogMessage)
Add a Line to Log (in it matches the current settings)
Definition logger.cpp:136
int current_severity_mask
Mask holding currently active severity levels.
Definition logger.h:212
void SaveLogSettings(void)
Definition logger.cpp:515
void PresetLogMode(bool OnOff)
Preset all of the Modes.
Definition logger.cpp:106
Logger(Ui::MainWindow *UI_Window)
The Log Constructor.
Definition logger.cpp:3
int current_mode_mask
Mask holding currently active modes.
Definition logger.h:220
void ReadSeverityMask(bool Unused)
Set the Severity Mask, based on window buttons.
Definition logger.cpp:242
void LogModeAll(void)
Turn All Modes On.
Definition logger.cpp:478
void SetMaxLines(int MaxLogLines)
Set the maximum number of lines the log will retain.
Definition logger.cpp:48
void ReadModeMask(bool Unused)
Set the Mode Mask, based on window buttons.
Definition logger.cpp:320
void LoadLogSettings(void)
Definition logger.cpp:166
QStringList severity_name_list
This list holds the names of the valid severity levels.
Definition logger.h:189
void PresetLogSeverity(bool OnOff)
Preset all of the Log Severity Levels.
Definition logger.cpp:84
void LogItemsUnhide(void)
Definition logger.cpp:498
~Logger()
The Log Destructor.
Definition logger.cpp:30
void LogSeverityNone(void)
Turn All Severities Off.
Definition logger.cpp:493
QStringList mode_name_list
This list holds the names of the valid modes.
Definition logger.h:195
void LogSeverityAll(void)
Turn All Severities On.
Definition logger.cpp:488
void RemoteLog(REMOTE_LOG_ENTRY LogEntry)
Receiver a Log Entry via a Public Slot.
Definition logger.cpp:554
void SaveSeverityMask(int SeverityMask)
Save the Log Severity Mask.
Definition logger.cpp:38
QStringList icon_name_list
This list holds the names of the severity level icons.
Definition logger.h:204
void SaveLog(void)
Save the Log Lines to a File.
Definition logger.cpp:59
void LogSelectItem(QListWidgetItem *Item)
Definition logger.cpp:469
#define DEFAULT_MAXIMUM_LOG_LINES
The maximum number of log lines kept.
Definition logger.h:72
LOGGING_SEVERITY
Log Severity allow the selection of logging events based on Severity.
Definition logger.h:48
@ LOG_CRITICAL
Definition logger.h:51
@ LOG_ERROR
Definition logger.h:52
@ LOG_INFO
Definition logger.h:55
@ LOG_EMERGENCY
Definition logger.h:49
@ LOG_ALERT
Definition logger.h:50
@ LOG_WARNING
Definition logger.h:53
@ LOG_DEBUG
Definition logger.h:56
@ LOG_NOTICE
Definition logger.h:54
LOGGING_MODE
Log Severity allow the selection of logging events based on the mode.
Definition logger.h:21
@ MODE_QT
Definition logger.h:23
@ MODE_FILE
Definition logger.h:32
@ MODE_SECURITY
Definition logger.h:28
@ MODE_OPERATOR
Definition logger.h:34
@ MODE_TIMING
Definition logger.h:27
@ MODE_GRAPHICS
Definition logger.h:29
@ MODE_SIG_PROC
Definition logger.h:22
@ MODE_THREAD
Definition logger.h:25
@ MODE_CONFIG
Definition logger.h:26
@ MODE_NETWORK
Definition logger.h:33
@ MODE_SENSOR
Definition logger.h:37
@ MODE_MEMORY
Definition logger.h:30
@ MODE_DATABASE
Definition logger.h:35
@ MODE_MATHS
Definition logger.h:31
@ MODE_GENERAL
Definition logger.h:24
@ MODE_EXCEPTION
Definition logger.h:36
Definition logger.h:60
LOGGING_MODE Mode
Definition logger.h:61
QString Message
Definition logger.h:63
LOGGING_SEVERITY Severity
Definition logger.h:62