mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Log.category for DBus server
This commit is contained in:
@@ -109,6 +109,12 @@ namespace BlackMisc
|
||||
return CDBusServer::isP2PConnection(connection) ? empty : CDBusServer::coreServiceName();
|
||||
}
|
||||
|
||||
const CLogCategoryList &CDBusServer::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats({ CLogCategory::dbus() });
|
||||
return cats;
|
||||
}
|
||||
|
||||
bool CDBusServer::isP2PAddress(const QString &address)
|
||||
{
|
||||
return modeOfAddress(address) == SERVERMODE_P2P;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifndef BLACKMISC_DBUSSERVER_H
|
||||
#define BLACKMISC_DBUSSERVER_H
|
||||
|
||||
#include "blackmisc/logcategorylist.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QDBusConnection>
|
||||
@@ -46,6 +47,9 @@ namespace BlackMisc
|
||||
//! Service name, empty if is P2P connection
|
||||
static const QString &coreServiceName(const QDBusConnection &connection);
|
||||
|
||||
//! Log categories
|
||||
static const CLogCategoryList &getLogCategories();
|
||||
|
||||
//! Server mode
|
||||
enum ServerMode
|
||||
{
|
||||
@@ -61,7 +65,7 @@ namespace BlackMisc
|
||||
CDBusServer(const QString &service, const QString &address, QObject *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CDBusServer();
|
||||
virtual ~CDBusServer() override;
|
||||
|
||||
//! Add a QObject to be exposed via DBus
|
||||
void addObject(const QString &name, QObject *object);
|
||||
|
||||
@@ -67,6 +67,13 @@ namespace BlackMisc
|
||||
return cat;
|
||||
}
|
||||
|
||||
//! DBus related
|
||||
static const CLogCategory &dbus()
|
||||
{
|
||||
static const CLogCategory cat { "swift.dbus" };
|
||||
return cat;
|
||||
}
|
||||
|
||||
//! Contexts
|
||||
static const CLogCategory &context()
|
||||
{
|
||||
@@ -297,6 +304,7 @@ namespace BlackMisc
|
||||
cmdLine(),
|
||||
context(),
|
||||
contextSlot(),
|
||||
dbus(),
|
||||
dataInconsistency(),
|
||||
download(),
|
||||
driver(),
|
||||
|
||||
@@ -28,6 +28,7 @@ namespace BlackMisc
|
||||
{ "cache", exactMatch(CLogCategory::cache()) },
|
||||
{ "cmd.line handling", exactMatch(CLogCategory::cmdLine()) },
|
||||
{ "data inconsistency", exactMatch(CLogCategory::dataInconsistency()) },
|
||||
{ "DBus", exactMatch(CLogCategory::dbus()) },
|
||||
{ "downloading data", exactMatch(CLogCategory::download()) },
|
||||
{ "driver", exactMatch(CLogCategory::driver()) },
|
||||
{ "flight plan", exactMatch(CLogCategory::flightPlan()) },
|
||||
|
||||
Reference in New Issue
Block a user