提交 b8c6a97d 编写于 作者: C Chinmay Garde

Add error logging when a dynamic service fails to load

This happens once per service
上级 b1984e94
......@@ -4,6 +4,7 @@
#include "sky/services/dynamic/dynamic_service_definition.h"
#include "base/logging.h"
#include <dlfcn.h>
namespace sky {
......@@ -35,6 +36,7 @@ void DynamicServiceDefinition::Setup(const mojo::String& dylib_path) {
std::lock_guard<std::mutex> lock(lifecycle_mtx_);
if (!OpenDylib(dylib_path)) {
LOG(ERROR) << "Could not open the service dylib.";
return;
}
......@@ -43,22 +45,27 @@ void DynamicServiceDefinition::Setup(const mojo::String& dylib_path) {
// performed *after* the version check is complete.
if (!AcquireServiceVersionProc()) {
LOG(ERROR) << "Could not acquire proc for service version check.";
return;
}
if (!CheckServiceVersion()) {
LOG(ERROR) << "Service and embedder versions mismatch.";
return;
}
if (!AcquireServiceProcs()) {
LOG(ERROR) << "Could not acquire procs for loading the service.";
return;
}
if (!InstallSystemThunks()) {
LOG(ERROR) << "Could not install system thunks to process the service.";
return;
}
if (!InvokeLibraryOnLoad()) {
LOG(ERROR) << "Could not invoke library OnLoad.";
return;
}
......
......@@ -57,6 +57,11 @@
_definition = sky::services::DynamicServiceDefinition::Initialize(dylib_path);
if (!_definition) {
LOG(ERROR) << "Could not load dynamic service for '"
<< _serviceName.UTF8String << "'";
}
// All known services are in the application bundle. If the service cannot
// be initialized once, dont attempt any more loads.
_initializationAttempted = YES;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册