Open Simulator Terrain Editor BRIGADOON-0007
Edit Terrain Files for Open Simulator Regions
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;
169
170 ui->MaxLogLines->setValue( settings.value( "Log_Setup/Allowed_lines", 500 ).toInt() );
171 ui->MaxLogLines->setMinimum( settings.value( "Log_Setup/Minimum_lines", 20 ).toInt() );
172 ui->MaxLogLines->setMaximum( settings.value( "Log_Setup/Maximum_lines", 20000 ).toInt() );
173
174 // Set the Connections
175 QObject::connect( ui->ModeSelectAll, SIGNAL( pressed( void ) ), this, SLOT( LogModeAll( void ) ) );
176 QObject::connect( ui->ModeClearAll, SIGNAL( pressed( void ) ), this, SLOT( LogModeNone( void ) ) );
177 QObject::connect( ui->SeveritySelectAll, SIGNAL( pressed( void ) ), this, SLOT( LogSeverityAll( void ) ) );
178 QObject::connect( ui->SeverityClearAll, SIGNAL( pressed( void ) ), this, SLOT( LogSeverityNone( void ) ) );
179 QObject::connect( ui->SaveLog, SIGNAL( pressed( void ) ), this, SLOT( SaveLog( void ) ) );
180 QObject::connect( ui->ClearLog, SIGNAL( pressed( void ) ), this, SLOT( ClearLog( void ) ) );
181 QObject::connect( ui->EmergencySelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
182 QObject::connect( ui->AlertSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
183 QObject::connect( ui->CriticalSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
184 QObject::connect( ui->ErrorSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
185 QObject::connect( ui->WarningSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
186 QObject::connect( ui->NoticeSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
187 QObject::connect( ui->InfoSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
188 QObject::connect( ui->DebugSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadSeverityMask( bool ) ) );
189 QObject::connect( ui->SigProcessSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
190 QObject::connect( ui->QtSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
191 QObject::connect( ui->GeneralSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
192 QObject::connect( ui->ThreadSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
193 QObject::connect( ui->ConfigSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
194 QObject::connect( ui->TimingSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
195 QObject::connect( ui->SecuritySelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
196 QObject::connect( ui->GraphicsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
197 QObject::connect( ui->MemorySelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
198 QObject::connect( ui->MathsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
199 QObject::connect( ui->FileOpsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
200 QObject::connect( ui->NetworkCommsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
201 QObject::connect( ui->OperatorSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
202 QObject::connect( ui->DatabaseSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
203 QObject::connect( ui->ExceptionsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
204 QObject::connect( ui->SensorsSelect, SIGNAL( clicked( bool ) ), this, SLOT( ReadModeMask( bool ) ) );
205 QObject::connect( this, SIGNAL( CountChanged( int ) ), ui->LogLineCounter, SLOT( display( int ) ) );
206 QObject::connect( ui->LogView, SIGNAL( itemClicked( QListWidgetItem * ) ), this, SLOT( LogSelectItem( QListWidgetItem * ) ) );
207 QObject::connect( ui->AllUnhideLog, SIGNAL( pressed( void) ), this, SLOT( LogItemsUnhide( void ) ) );
208 QObject::connect( ui->MaxLogLines, SIGNAL( valueChanged( int) ), this, SLOT( UpdateMaxLogLines( int ) ) );
209
210 ui->EmergencySelect->setChecked( settings.value( "Log_Severity/Emergency", true ).toBool() );
211 ui->AlertSelect->setChecked( settings.value( "Log_Severity/Alert", true ).toBool() );
212 ui->CriticalSelect->setChecked( settings.value( "Log_Severity/Critical", true ).toBool() );
213 ui->ErrorSelect->setChecked( settings.value( "Log_Severity/Error", true ).toBool() );
214 ui->WarningSelect->setChecked( settings.value( "Log_Severity/Warning", true ).toBool() );
215 ui->NoticeSelect->setChecked( settings.value( "Log_Severity/Notice", true ).toBool() );
216 ui->InfoSelect->setChecked( settings.value( "Log_Severity/Info", true ).toBool() );
217 ui->DebugSelect->setChecked( settings.value( "Log_Severity/Debug", true ).toBool() );
218 ReadSeverityMask( true );
219
220 // Load the Mode Settings
221 ui->SigProcessSelect->setChecked( settings.value( "Log_Mode/SigProc", true ).toBool() );
222 ui->QtSelect->setChecked( settings.value( "Log_Mode/Qt", true ).toBool() );
223 ui->GeneralSelect->setChecked( settings.value( "Log_Mode/General", true ).toBool() );
224 ui->ThreadSelect->setChecked( settings.value( "Log_Mode/Thread", true ).toBool() );
225 ui->ConfigSelect->setChecked( settings.value( "Log_Mode/Configuration", true ).toBool() );
226 ui->TimingSelect->setChecked( settings.value( "Log_Mode/Timing", true ).toBool() );
227 ui->SecuritySelect->setChecked( settings.value( "Log_Mode/Security", true ).toBool() );
228 ui->GraphicsSelect->setChecked( settings.value( "Log_Mode/Graphics", true ).toBool() );
229 ui->MemorySelect->setChecked( settings.value( "Log_Mode/Memory", true ).toBool() );
230 ui->MathsSelect->setChecked( settings.value( "Log_Mode/Maths", true ).toBool() );
231 ui->FileOpsSelect->setChecked( settings.value( "Log_Mode/File", true ).toBool() );
232 ui->NetworkCommsSelect->setChecked( settings.value( "Log_Mode/Network", true ).toBool() );
233 ui->OperatorSelect->setChecked( settings.value( "Log_Mode/Operator", true ).toBool() );
234 ui->DatabaseSelect->setChecked( settings.value( "Log_Mode/Database", true ).toBool() );
235 ui->ExceptionsSelect->setChecked( settings.value( "Log_Mode/Exception", true ).toBool() );
236 ui->SensorsSelect->setChecked( settings.value( "Log_Mode/Sensors", true ).toBool() );
237 ReadModeMask( true );
238}
239
240// Read Severity Mask
241void Logger::ReadSeverityMask( bool Unused )
242{
243 int severity_mask = 0;
244
245 if ( ui->EmergencySelect->isChecked() )
246 {
247 severity_mask |= 1 << LOG_EMERGENCY;
248 }
249 else
250 {
251 severity_mask &= ~(1 << LOG_EMERGENCY);
252 }
253
254 if ( ui->AlertSelect->isChecked() )
255 {
256 severity_mask |= 1 << LOG_ALERT;
257 }
258 else
259 {
260 severity_mask &= ~(1 << LOG_ALERT);
261 }
262
263 if ( ui->CriticalSelect->isChecked() )
264 {
265 severity_mask |= 1 << LOG_CRITICAL;
266 }
267 else
268 {
269 severity_mask &= ~(1 << LOG_CRITICAL);
270 }
271
272 if ( ui->ErrorSelect->isChecked() )
273 {
274 severity_mask |= 1 << LOG_ERROR;
275 }
276 else
277 {
278 severity_mask &= ~(1 << LOG_ERROR);
279 }
280
281 if ( ui->WarningSelect->isChecked() )
282 {
283 severity_mask |= 1 << LOG_WARNING;
284 }
285 else
286 {
287 severity_mask &= ~(1 << LOG_WARNING);
288 }
289
290 if ( ui->NoticeSelect->isChecked() )
291 {
292 severity_mask |= 1 << LOG_NOTICE;
293 }
294 else
295 {
296 severity_mask &= ~(1 << LOG_NOTICE);
297 }
298
299 if ( ui->InfoSelect->isChecked() )
300 {
301 severity_mask |= 1 << LOG_INFO;
302 }
303 else
304 {
305 severity_mask &= ~(1 << LOG_INFO);
306 }
307
308 if ( ui->DebugSelect->isChecked() )
309 {
310 severity_mask |= 1 << LOG_DEBUG;
311 }
312 else
313 {
314 severity_mask &= ~(1 << LOG_DEBUG);
315 }
316 SaveSeverityMask( severity_mask );
317}
318
319void Logger::ReadModeMask( bool Unused )
320{
321 int mode_mask = 0;
322
323 if ( ui->SigProcessSelect->isChecked() )
324 {
325 mode_mask |= 1 << MODE_SIG_PROC;
326 }
327 else
328 {
329 mode_mask &= ~(1 << MODE_SIG_PROC);
330 }
331 if ( ui->QtSelect->isChecked() )
332 {
333 mode_mask |= 1 << MODE_QT;
334 }
335 else
336 {
337 mode_mask &= ~(1 << MODE_QT);
338 }
339
340 if ( ui->GeneralSelect->isChecked() )
341 {
342 mode_mask |= 1 << MODE_GENERAL;
343 }
344 else
345 {
346 mode_mask &= ~(1 << MODE_GENERAL);
347 }
348
349 if ( ui->ThreadSelect->isChecked() )
350 {
351 mode_mask |= 1 << MODE_THREAD;
352 }
353 else
354 {
355 mode_mask &= ~(1 << MODE_THREAD);
356 }
357
358 if ( ui->ConfigSelect->isChecked() )
359 {
360 mode_mask |= 1 << MODE_CONFIG;
361 }
362 else
363 {
364 mode_mask &= ~(1 << MODE_CONFIG);
365 }
366
367 if ( ui->TimingSelect->isChecked() )
368 {
369 mode_mask |= 1 << MODE_TIMING;
370 }
371 else
372 {
373 mode_mask &= ~(1 << MODE_TIMING);
374 }
375
376 if ( ui->SecuritySelect->isChecked() )
377 {
378 mode_mask |= 1 << MODE_SECURITY;
379 }
380 else
381 {
382 mode_mask &= ~(1 << MODE_SECURITY);
383 }
384
385 if ( ui->GraphicsSelect->isChecked() )
386 {
387 mode_mask |= 1 << MODE_GRAPHICS;
388 }
389 else
390 {
391 mode_mask &= ~(1 << MODE_GRAPHICS);
392 }
393
394 if ( ui->MemorySelect->isChecked() )
395 {
396 mode_mask |= 1 << MODE_MEMORY;
397 }
398 else
399 {
400 mode_mask &= ~(1 << MODE_MEMORY);
401 }
402
403 if ( ui->MathsSelect->isChecked() )
404 {
405 mode_mask |= 1 << MODE_MATHS;
406 }
407 else
408 {
409 mode_mask &= ~(1 << MODE_MATHS);
410 }
411
412 if ( ui->FileOpsSelect->isChecked() )
413 {
414 mode_mask |= 1 << MODE_FILE;
415 }
416 else
417 {
418 mode_mask &= ~(1 << MODE_FILE);
419 }
420
421 if ( ui->NetworkCommsSelect->isChecked() )
422 {
423 mode_mask |= 1 << MODE_NETWORK;
424 }
425 else
426 {
427 mode_mask &= ~(1 << MODE_NETWORK);
428 }
429
430 if ( ui->OperatorSelect->isChecked() )
431 {
432 mode_mask |= 1 << MODE_OPERATOR;
433 }
434 else
435 {
436 mode_mask &= ~(1 << MODE_OPERATOR);
437 }
438
439 if ( ui->DatabaseSelect->isChecked() )
440 {
441 mode_mask |= 1 << MODE_DATABASE;
442 }
443 else
444 {
445 mode_mask &= ~(1 << MODE_DATABASE);
446 }
447
448 if ( ui->ExceptionsSelect->isChecked() )
449 {
450 mode_mask |= 1 << MODE_EXCEPTION;
451 }
452 else
453 {
454 mode_mask &= ~(1 << MODE_EXCEPTION);
455 }
456
457 if ( ui->SensorsSelect->isChecked() )
458 {
459 mode_mask |= 1 << MODE_SENSOR;
460 }
461 else
462 {
463 mode_mask &= ~(1 << MODE_SENSOR);
464 }
465 SaveModeMask( mode_mask );
466}
467
468void Logger::LogSelectItem( QListWidgetItem * Item )
469{
470 // If Hidden Selected, Hide the Log Line
471 if ( ui->HideSelectedLog->isChecked() )
472 {
473 Item->setHidden( true );
474 }
475}
476
478{
479 PresetLogMode( true );
480}
481
483{
484 PresetLogMode( false );
485}
486
488{
489 PresetLogSeverity( true );
490}
491
493{
494 PresetLogSeverity( false );
495}
496
498{
499 for ( int row = 0; row < ui->LogView->count(); ++row )
500 {
501 QListWidgetItem *item = ui->LogView->item( row );
502 if ( item != nullptr )
503 {
504 item->setHidden( false );
505 }
506 }
507}
508
510{
511 SetMaxLines( Value );
512}
513
515{
516 QSettings settings;
517
518 // Save the Log Severity Settings
519 settings.setValue( "Log_Severity/Emergency", ui->EmergencySelect->isChecked() );
520 settings.setValue( "Log_Severity/Alert", ui->AlertSelect->isChecked() );
521 settings.setValue( "Log_Severity/Critical", ui->CriticalSelect->isChecked() );
522 settings.setValue( "Log_Severity/Error", ui->ErrorSelect->isChecked() );
523 settings.setValue( "Log_Severity/Warning", ui->WarningSelect->isChecked() );
524 settings.setValue( "Log_Severity/Notice", ui->NoticeSelect->isChecked() );
525 settings.setValue( "Log_Severity/Info", ui->InfoSelect->isChecked() );
526 settings.setValue( "Log_Severity/Debug", ui->DebugSelect->isChecked() );
527
528
529 // Save the Mode Settings
530 settings.setValue( "Log_Mode/SigProc", ui->SigProcessSelect->isChecked() );
531 settings.setValue( "Log_Mode/Qt", ui->QtSelect->isChecked() );
532 settings.setValue( "Log_Mode/General", ui->GeneralSelect->isChecked() );
533 settings.setValue( "Log_Mode/Thread", ui->ThreadSelect->isChecked() );
534 settings.setValue( "Log_Mode/Configuration", ui->ConfigSelect->isChecked() );
535 settings.setValue( "Log_Mode/Timing", ui->TimingSelect->isChecked() );
536 settings.setValue( "Log_Mode/Security", ui->SecuritySelect->isChecked() );
537 settings.setValue( "Log_Mode/Graphics", ui->GraphicsSelect->isChecked() );
538 settings.setValue( "Log_Mode/Memory", ui->MemorySelect->isChecked() );
539 settings.setValue( "Log_Mode/Maths", ui->MathsSelect->isChecked() );
540 settings.setValue( "Log_Mode/File", ui->FileOpsSelect->isChecked() );
541 settings.setValue( "Log_Mode/Network", ui->NetworkCommsSelect->isChecked() );
542 settings.setValue( "Log_Mode/Operator", ui->OperatorSelect->isChecked() );
543 settings.setValue( "Log_Mode/Database", ui->DatabaseSelect->isChecked() );
544 settings.setValue( "Log_Mode/Exception", ui->ExceptionsSelect->isChecked() );
545 settings.setValue( "Log_Mode/Sensors", ui->SensorsSelect->isChecked() );
546
547 // Save Log Parameters
548 settings.setValue( "Log_Setup/Allowed_lines", ui->MaxLogLines->value() );
549 settings.setValue( "Log_Setup/Minimum_lines", ui->MaxLogLines->minimum() );
550 settings.setValue( "Log_Setup/Maximum_lines", ui->MaxLogLines->maximum() );
551}
552
554{
555 Add( LogEntry.Severity, LogEntry.Mode, LogEntry.Message );
556}
void UpdateMaxLogLines(int Value)
Definition logger.cpp:509
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:482
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:514
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:241
void LogModeAll(void)
Turn All Modes On.
Definition logger.cpp:477
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:319
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:497
~Logger()
The Log Destructor.
Definition logger.cpp:30
void LogSeverityNone(void)
Turn All Severities Off.
Definition logger.cpp:492
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:487
void RemoteLog(REMOTE_LOG_ENTRY LogEntry)
Receiver a Log Entry via a Public Slot.
Definition logger.cpp:553
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:468
#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