improved logs

This commit is contained in:
Francesco Mangiacrapa 2021-02-18 14:45:43 +01:00
parent 1aff1584fb
commit 0070ebc06d
1 changed files with 5 additions and 4 deletions

View File

@ -1068,7 +1068,7 @@ public class DataCatalogueImpl implements DataCatalogue {
*/ */
@Override @Override
public boolean patchFieldsForDataset(String datasetIdOrName, Map<String, String> mapFields) throws Exception { public boolean patchFieldsForDataset(String datasetIdOrName, Map<String, String> mapFields) throws Exception {
LOG.info("Called patch the fields " + mapFields + " for dataset id/name: " + datasetIdOrName); LOG.info("Called patchFieldsForDataset " + mapFields + " for dataset id/name: " + datasetIdOrName);
checkNotNull(datasetIdOrName); checkNotNull(datasetIdOrName);
checkNotNull(mapFields); checkNotNull(mapFields);
@ -1128,7 +1128,7 @@ public class DataCatalogueImpl implements DataCatalogue {
*/ */
@Override @Override
public String addResourceToDataset(ResourceBean resourceBean) throws Exception { public String addResourceToDataset(ResourceBean resourceBean) throws Exception {
LOG.info("Request to add a resource described by this bean " + resourceBean); LOG.info("Called addResourceToDataset by this bean " + resourceBean);
// checks // checks
checkNotNull(resourceBean); checkNotNull(resourceBean);
@ -1157,7 +1157,7 @@ public class DataCatalogueImpl implements DataCatalogue {
CkanResource createdRes = MarshUnmarshCkanObject.toCkanResource(jsonValueResource); CkanResource createdRes = MarshUnmarshCkanObject.toCkanResource(jsonValueResource);
if (createdRes != null) { if (createdRes != null) {
LOG.debug("Resource " + createdRes.getName() + " added correclty"); LOG.info("Resource with id: " + createdRes.getId() + ", name: "+createdRes.getName()+" added correclty");
return createdRes.getId(); return createdRes.getId();
} }
}catch (Exception e) { }catch (Exception e) {
@ -1172,7 +1172,7 @@ public class DataCatalogueImpl implements DataCatalogue {
*/ */
@Override @Override
public boolean deleteResourceFromDataset(String resourceId) throws Exception { public boolean deleteResourceFromDataset(String resourceId) throws Exception {
LOG.info("Request to delete a resource with id " + resourceId); LOG.info("Called deleteResourceFromDataset - resource with id " + resourceId);
// checks // checks
checkNotNull(resourceId); checkNotNull(resourceId);
@ -1181,6 +1181,7 @@ public class DataCatalogueImpl implements DataCatalogue {
try{ try{
CkanResource theResource = ckanCaller.getResource(resourceId); CkanResource theResource = ckanCaller.getResource(resourceId);
gCatCaller.deleteResource(theResource.getPackageId(), resourceId); gCatCaller.deleteResource(theResource.getPackageId(), resourceId);
LOG.info("Resource with id: " + resourceId + " deleted correclty");
return true; return true;
}catch(Exception e){ }catch(Exception e){