Deploy logging SP inside SPs

Make SPs use logging SP. For this the log_client instance
needs to be initialized inside the SPs, using the provided
factory method.

Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Signed-off-by: Gabor Ambrus <gabor.ambrus@arm.com>
Change-Id: If4d41d15a1488943ceb00d9453b5c38d2bad10c1
diff --git a/deployments/protected-storage/env/commonsp/ps_sp.c b/deployments/protected-storage/env/commonsp/ps_sp.c
index c77d9fd..c43bccb 100644
--- a/deployments/protected-storage/env/commonsp/ps_sp.c
+++ b/deployments/protected-storage/env/commonsp/ps_sp.c
@@ -9,6 +9,7 @@
 #include "components/service/secure_storage/factory/storage_factory.h"
 #include "components/service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.h"
 #include "components/service/secure_storage/frontend/secure_storage_provider/secure_storage_uuid.h"
+#include "components/service/log/factory/log_factory.h"
 #include "sp_api.h"
 #include "sp_discovery.h"
 #include "sp_messaging.h"
@@ -40,6 +41,13 @@
 		goto fatal_error;
 	}
 
+	IMSG("Start discovering logging service");
+	if (log_factory_create()) {
+		IMSG("Logging service discovery successful");
+	} else {
+		EMSG("Logging service discovery failed, falling back to console log");
+	}
+
 	result = sp_discovery_own_id_get(&own_id);
 	if (result != SP_RESULT_OK) {
 		EMSG("Failed to query own ID: %d", result);