GODT-1672: Forward QML log to bridge.

This commit is contained in:
Xavier Michelon
2022-07-25 10:47:27 +02:00
committed by Jakub
parent 649364beb5
commit 055829dcf8
17 changed files with 3081 additions and 1796 deletions

View File

@ -40,7 +40,7 @@ int const maxCertificateWaitMsecs = 60 * 1000; ///< Ammount of time we wait for
}
//****************************************************************************************************************************************************
/// \return user configuration directory used by bridge (based on Golang OS/File::UserConfigDir).
/// \return user configuration directory used by bridge (based on Golang OS/File's UserConfigDir).
//****************************************************************************************************************************************************
static const QString _userConfigDir(){
QString dir;
@ -167,6 +167,22 @@ bool GRPCClient::connectToServer(QString &outError)
}
//****************************************************************************************************************************************************
/// \param[in] level The level of the log entry.
/// \param[in] package The package (component) that triggered the entry.
/// \param[in] message The message.
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
grpc::Status GRPCClient::addLogEntry(Log::Level level, QString const &package, QString const &message)
{
grpc::ClientContext ctx;
AddLogEntryRequest request;
request.set_level(logLevelToGRPC(level));
request.set_package(package.toStdString());
request.set_message(message.toStdString());
return stub_->AddLogEntry(&ctx, request, &empty);
}
//****************************************************************************************************************************************************
/// \return The status for the gRPC call.
//****************************************************************************************************************************************************
@ -1291,5 +1307,3 @@ void GRPCClient::processUserEvent(UserEvent const &event)
app().log().error("Unknown User event received.");
}
}