Overte C++ Documentation
AbstractLoggerInterface.h
1 //
2 // AbstractLoggerInterface.h
3 // interface/src
4 //
5 // Created by Stojce Slavkovski on 12/22/13.
6 // Copyright 2013 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_AbstractLoggerInterface_h
13 #define hifi_AbstractLoggerInterface_h
14 
15 #include <QtCore/QObject>
16 #include <QString>
17 #include <QStringList>
18 
19 class AbstractLoggerInterface : public QObject {
20  Q_OBJECT
21 
22 public:
23  static AbstractLoggerInterface* get();
24  AbstractLoggerInterface(QObject* parent = NULL);
25  ~AbstractLoggerInterface();
26  inline bool showSourceDebugging() { return _showSourceDebugging; }
27  inline bool extraDebugging() { return _extraDebugging; }
28  inline bool debugPrint() { return _debugPrint; }
29  inline bool infoPrint() { return _infoPrint; }
30  inline bool criticalPrint() { return _criticalPrint; }
31  inline bool warningPrint() { return _warningPrint; }
32  inline bool suppressPrint() { return _suppressPrint; }
33  inline bool fatalPrint() { return _fatalPrint; }
34  inline bool unknownPrint() { return _unknownPrint; }
35  inline void setShowSourceDebugging(bool showSourceDebugging) { _showSourceDebugging = showSourceDebugging; }
36  inline void setExtraDebugging(bool extraDebugging) { _extraDebugging = extraDebugging; }
37  inline void setDebugPrint(bool debugPrint) { _debugPrint = debugPrint; }
38  inline void setInfoPrint(bool infoPrint) { _infoPrint = infoPrint; }
39  inline void setCriticalPrint(bool criticalPrint) { _criticalPrint = criticalPrint; }
40  inline void setWarningPrint(bool warningPrint) { _warningPrint = warningPrint; }
41  inline void setSuppressPrint(bool suppressPrint) { _suppressPrint = suppressPrint; }
42  inline void setFatalPrint(bool fatalPrint) { _fatalPrint = fatalPrint; }
43  inline void setUnknownPrint(bool unknownPrint) { _unknownPrint = unknownPrint; }
44 
45  virtual void addMessage(const QString&) = 0;
46  virtual QString getLogData(const qint64 maxSize = 0) = 0;
47  virtual void locateLog() = 0;
48  virtual void sync() {}
49 
50 signals:
51  void logReceived(QString message);
52 
53 private:
54  bool _showSourceDebugging{ false };
55  bool _extraDebugging{ false };
56  bool _debugPrint{ true };
57  bool _infoPrint{ true };
58  bool _criticalPrint{ true };
59  bool _warningPrint{ true };
60  bool _suppressPrint{ true };
61  bool _fatalPrint{ true };
62  bool _unknownPrint{ true };
63 };
64 
65 #endif // hifi_AbstractLoggerInterface_h