TreeFrogFramework  2.8
tloggerplugin.h
Go to the documentation of this file.
1 #pragma once
2 #include <QObject>
3 #include <QStringList>
4 #include <QtPlugin>
5 #include <TGlobal>
6 
7 class TLogger;
8 
9 constexpr auto TLoggerInterface_iid = "org.treefrogframework.TreeFrog.TLoggerInterface/1.0";
10 
11 
13 public:
14  virtual ~TLoggerInterface() { }
15  virtual TLogger *create(const QString &key) = 0;
16 };
17 
18 Q_DECLARE_INTERFACE(TLoggerInterface, TLoggerInterface_iid)
19 
20 
21 class T_CORE_EXPORT TLoggerPlugin : public QObject, public TLoggerInterface {
22  Q_OBJECT
23  Q_INTERFACES(TLoggerInterface)
24 
25 public:
26  explicit TLoggerPlugin(QObject *parent = 0) :
27  QObject(parent) { }
29 
30  virtual TLogger *create(const QString &key) = 0;
31 };
32 
The TLoggerInterface class provides an interface to implement TLogger plugins.
Definition: tloggerplugin.h:12
virtual TLogger * create(const QString &key)=0
virtual ~TLoggerInterface()
Definition: tloggerplugin.h:14
The TLoggerPlugin class provides an abstract base for custom TLogger plugins.
Definition: tloggerplugin.h:21
virtual TLogger * create(const QString &key)=0
Implement this function to create a logger matching the name specified by the given key.
~TLoggerPlugin()
Definition: tloggerplugin.h:28
TLoggerPlugin(QObject *parent=0)
Constructor.
Definition: tloggerplugin.h:26
The TLogger class provides an abstract base of logging functionality.
Definition: tlogger.h:21
#define T_CORE_EXPORT
Definition: tdeclexport.h:28
constexpr auto TLoggerInterface_iid
Definition: tloggerplugin.h:9