SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
loggerwithfile.h
Go to the documentation of this file.
1 /*
2  * loggerwithfile.h
3  *
4  * Created on: Nov 11, 2017
5  * Author: f4exb
6  */
7 
8 #ifndef LOGGING_LOGGERWITHFILE_H_
9 #define LOGGING_LOGGERWITHFILE_H_
10 
11 #include <QtGlobal>
12 #include "logger.h"
13 #include "filelogger.h"
14 
15 #include "export.h"
16 
17 namespace qtwebapp {
18 
26  Q_OBJECT
27  Q_DISABLE_COPY(LoggerWithFile)
28 
29 public:
30  LoggerWithFile(QObject *parent = 0);
31  virtual ~LoggerWithFile();
32 
33  void createOrSetFileLogger(const FileLoggerSettings& settings, const int refreshInterval=10000);
34  void destroyFileLogger();
35 
46  virtual void log(const QtMsgType type, const QString& message, const QString &file="", const QString &function="", const int line=0);
47 
54  virtual void clear(const bool buffer=true, const bool variables=true);
55 
56  bool getUseFileLogger() const { return useFileFlogger; }
57  void setUseFileLogger(bool use) { useFileFlogger = use; }
58  bool hasFileLogger() const { return fileLogger != 0; }
59 
64  FileLoggerSettings getFileLoggerSettings() const { return fileLogger->getFileLoggerSettings(); }
65 
70  void setFileLoggerSettings(const FileLoggerSettings& settings) { fileLogger->setFileLoggerSettings(settings); }
71 
72  void setConsoleMinMessageLevel(const QtMsgType& msgLevel);
73  void setFileMinMessageLevel(const QtMsgType& msgLevel);
74 
75  void getConsoleMinMessageLevelStr(QString& levelStr);
76  void getFileMinMessageLevelStr(QString& levelStr);
77  void getLogFileName(QString& fileName);
78 
80  void logToFile(const QtMsgType type, const QString& message, const QString &file="", const QString &function="", const int line=0);
81 
82 private:
85 
88 
91 };
92 
93 } // end of namespace
94 
95 #endif /* LOGGING_LOGGERWITHFILE_H_ */
void setUseFileLogger(bool use)
bool getUseFileLogger() const
FileLoggerSettings getFileLoggerSettings() const
void setFileLoggerSettings(const FileLoggerSettings &settings)
Fixed< IntType, IntBits > log(Fixed< IntType, IntBits > const &x)
Definition: fixed.h:2295
#define LOGGING_API
Definition: export.h:100