From 6c67cccd6336bfe1e7b0ea0c749a36fab8131120 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 29 Apr 2024 17:23:39 +0200 Subject: [PATCH] Improving code and logging --- .../org/gcube/accounting/datamodel/BasicUsageRecord.java | 2 +- .../persistence/AccountingPersistenceConfiguration.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/accounting/datamodel/BasicUsageRecord.java b/src/main/java/org/gcube/accounting/datamodel/BasicUsageRecord.java index e73ef59..e614a56 100644 --- a/src/main/java/org/gcube/accounting/datamodel/BasicUsageRecord.java +++ b/src/main/java/org/gcube/accounting/datamodel/BasicUsageRecord.java @@ -54,7 +54,7 @@ public abstract class BasicUsageRecord extends AbstractRecord implements UsageRe this.setScope(context); } catch (Throwable t) { logger.warn( - "Unable to automaticcally set the scope using scope provider. The record will not be valid if the scope will not be explicitly set."); + "Unable to automatically set the context using the known providers. The record will not be valid if the scope will not be explicitly set."); } } diff --git a/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceConfiguration.java b/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceConfiguration.java index 4b9028e..9e5a1f2 100644 --- a/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceConfiguration.java +++ b/src/main/java/org/gcube/accounting/persistence/AccountingPersistenceConfiguration.java @@ -41,13 +41,13 @@ public class AccountingPersistenceConfiguration extends PersistenceBackendConfig public AccountingPersistenceConfiguration(Class clz) throws Exception { super(); - String context = ContextUtility.getCurrentContextFullName(); try { ServiceEndpoint serviceEndpoint = getServiceEndpoint(SERVICE_ENDPOINT_CATEGORY, SERVICE_ENDPOINT_NAME, clz); setValues(serviceEndpoint, clz); }catch (Exception e) { - logger.error("Error while instancing {} in context {}", this.getClass().getSimpleName(), context - , e); + String context = ContextUtility.getCurrentContextFullName(); + logger.error("Error while instancing {} in context {}", + this.getClass().getSimpleName(), context, e); } }