NetSim 1.0.0
An educational network simulation software for students
Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
1#ifndef LOGGER_H
2#define LOGGER_H
3
4#include <QDebug>
5#include <QFile>
6#include <QHash>
7
11
12namespace NetSim {
13
16
26class Logger {
27public:
33 static void init();
34
40 static void clean();
41
49 static void messageOutput(QtMsgType type, const QMessageLogContext &context,
50 const QString &msg);
51
52private:
54 static QFile *logFile;
55
57 static bool isInit;
58
60 static QHash<QtMsgType, QString> contextNames;
61};
62} // namespace NetSim
63
64#endif // LOGGER_H
A utility class that provides static methods for logging messages.
Definition logger.h:26
static void messageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg)
Outputs log messages based on their type and context.
Definition logger.cpp:51
static void clean()
Cleans up resources used by the logger.
Definition logger.cpp:43
static void init()
Initializes the logger.
Definition logger.cpp:22
Definition logger.h:12