improved the logs

This commit is contained in:
Francesco Mangiacrapa 2021-10-06 16:54:59 +02:00
parent 27d03e04eb
commit 4b5d5a082f
1 changed files with 46 additions and 14 deletions

View File

@ -62,11 +62,15 @@ public class ConvertToDataViewModel {
* @throws Exception the exception * @throws Exception the exception
*/ */
public static ConcessioneDV toConcessione(Concessione concessione) throws Exception { public static ConcessioneDV toConcessione(Concessione concessione) throws Exception {
LOG.debug("called toConcessione for: " + concessione); LOG.debug("toConcessione called");
if (concessione == null) if (concessione == null)
return null; return null;
LOG.debug("toConcessione called for concessione with mongoId: " + concessione.getMongo_id());
if (LOG.isTraceEnabled())
LOG.trace("Source concessione is: " + concessione);
try { try {
ConcessioneDV theConcessione = new ConcessioneDV(); ConcessioneDV theConcessione = new ConcessioneDV();
@ -141,7 +145,11 @@ public class ConvertToDataViewModel {
theConcessione.setPosizionamentoScavo(thePosizScavo); theConcessione.setPosizionamentoScavo(thePosizScavo);
} }
LOG.debug("Returning concessione: " + theConcessione); LOG.debug("Returning concessioneDV with id: " + theConcessione.getItemId());
if (LOG.isTraceEnabled())
LOG.trace("Returning: " + theConcessione);
return theConcessione; return theConcessione;
} catch (Exception e) { } catch (Exception e) {
LOG.error("Error on converting concessione: " + concessione, e); LOG.error("Error on converting concessione: " + concessione, e);
@ -160,11 +168,16 @@ public class ConvertToDataViewModel {
*/ */
public static ConcessioneDV toMetadataConcessione(Concessione concessione, boolean includeValidationReport) public static ConcessioneDV toMetadataConcessione(Concessione concessione, boolean includeValidationReport)
throws Exception { throws Exception {
LOG.debug("called toConcessione for: " + concessione); LOG.debug("toMetadataConcessione called");
if (concessione == null) if (concessione == null)
return null; return null;
LOG.debug("toMetadataConcessione called for concessione with [mongoId: " + concessione.getMongo_id()
+ ", includeValidationReport: " + includeValidationReport + "]");
if (LOG.isTraceEnabled())
LOG.trace("Source concessione is: " + concessione);
try { try {
ConcessioneDV theConcessione = new ConcessioneDV(); ConcessioneDV theConcessione = new ConcessioneDV();
@ -202,7 +215,11 @@ public class ConvertToDataViewModel {
theConcessione.setValidationStatus(theConcessione.getValidationReport().getStatus()); theConcessione.setValidationStatus(theConcessione.getValidationReport().getStatus());
} }
LOG.debug("Returning base concessione: " + theConcessione); LOG.info("Returning concessioneDV with id: " + theConcessione.getItemId());
if (LOG.isTraceEnabled())
LOG.trace("Returning: " + theConcessione);
return theConcessione; return theConcessione;
} catch (Exception e) { } catch (Exception e) {
LOG.error("Error on converting concessione: " + concessione, e); LOG.error("Error on converting concessione: " + concessione, e);
@ -219,17 +236,20 @@ public class ConvertToDataViewModel {
* @throws Exception the exception * @throws Exception the exception
*/ */
public static ValidationReportDV toValidationReport(ValidationReport validationReport) throws Exception { public static ValidationReportDV toValidationReport(ValidationReport validationReport) throws Exception {
LOG.debug("called toValidationReport for: " + validationReport); LOG.debug("toValidationReport called");
if (validationReport == null) if (validationReport == null)
return null; return null;
LOG.debug("toValidationReport called for: "+validationReport);
ValidationReportDV theVR = new ValidationReportDV(); ValidationReportDV theVR = new ValidationReportDV();
theVR.setErrorMessages(validationReport.getErrorMessages()); theVR.setErrorMessages(validationReport.getErrorMessages());
theVR.setObjectName(validationReport.getObjectName()); theVR.setObjectName(validationReport.getObjectName());
theVR.setStatus(ValidationStatus.valueOf(validationReport.getStatus().name())); theVR.setStatus(ValidationStatus.valueOf(validationReport.getStatus().name()));
theVR.setWarningMessages(validationReport.getWarningMessages()); theVR.setWarningMessages(validationReport.getWarningMessages());
theVR.setAsJSONString(toJSON(validationReport)); theVR.setAsJSONString(toJSON(validationReport));
LOG.debug("Returning: "+theVR);
return theVR; return theVR;
} }
@ -241,11 +261,15 @@ public class ConvertToDataViewModel {
* @throws Exception the exception * @throws Exception the exception
*/ */
public static BaseConcessioneDV toBaseConcessione(Concessione concessione) throws Exception { public static BaseConcessioneDV toBaseConcessione(Concessione concessione) throws Exception {
LOG.debug("called toBaseConcessione for: " + concessione); LOG.debug("toBaseConcessione called");
if (concessione == null) if (concessione == null)
return null; return null;
LOG.debug("toBaseConcessione called for concessione with mongoId: " + concessione.getMongo_id());
if (LOG.isTraceEnabled())
LOG.trace("Source concessione is: " + concessione);
try { try {
BaseConcessioneDV theConcessione = new BaseConcessioneDV(); BaseConcessioneDV theConcessione = new BaseConcessioneDV();
@ -262,7 +286,11 @@ public class ConvertToDataViewModel {
theConcessione.setLastUpdateUser(toUser(concessione.getLastUpdateUser())); theConcessione.setLastUpdateUser(toUser(concessione.getLastUpdateUser()));
theConcessione.setLicenzaID(concessione.getLicenzaID()); theConcessione.setLicenzaID(concessione.getLicenzaID());
LOG.debug("Returning base concessione: " + theConcessione); LOG.debug("Returning BaseConcessioneDV with id: " + theConcessione.getItemId());
if (LOG.isTraceEnabled())
LOG.trace("Returning: " + theConcessione);
return theConcessione; return theConcessione;
} catch (Exception e) { } catch (Exception e) {
LOG.error("Error on converting concessione: " + concessione, e); LOG.error("Error on converting concessione: " + concessione, e);
@ -342,6 +370,7 @@ public class ConvertToDataViewModel {
* @return the abstract relazione scavo DV * @return the abstract relazione scavo DV
*/ */
public static AbstractRelazioneScavoDV toAbstractRelazioneScavo(AbstractRelazione abstractRelazione) { public static AbstractRelazioneScavoDV toAbstractRelazioneScavo(AbstractRelazione abstractRelazione) {
LOG.debug("toAbstractRelazioneScavo called");
if (abstractRelazione == null) if (abstractRelazione == null)
return null; return null;
@ -379,6 +408,7 @@ public class ConvertToDataViewModel {
* @return the relazione scavo data view * @return the relazione scavo data view
*/ */
public static RelazioneScavoDV toRelazioneScavo(RelazioneScavo relazioneScavo) { public static RelazioneScavoDV toRelazioneScavo(RelazioneScavo relazioneScavo) {
LOG.debug("toRelazioneScavo called");
if (relazioneScavo == null) if (relazioneScavo == null)
return null; return null;
@ -416,6 +446,7 @@ public class ConvertToDataViewModel {
* @return the uploaded image data-view * @return the uploaded image data-view
*/ */
public static UploadedImageDV toUploadedImage(UploadedImage uploadedImage) { public static UploadedImageDV toUploadedImage(UploadedImage uploadedImage) {
LOG.debug("toUploadedImage called");
if (uploadedImage == null) if (uploadedImage == null)
return null; return null;
@ -455,6 +486,8 @@ public class ConvertToDataViewModel {
* @return the workspace content DV * @return the workspace content DV
*/ */
public static WorkspaceContentDV toWorkspaceContent(WorkspaceContent wContent) { public static WorkspaceContentDV toWorkspaceContent(WorkspaceContent wContent) {
LOG.debug("toWorkspaceContent called");
if (wContent == null) if (wContent == null)
return null; return null;
@ -566,10 +599,9 @@ public class ConvertToDataViewModel {
} }
public static FileSetPathsDV getFileSetPaths() { public static FileSetPathsDV getFileSetPaths() {
LOG.info("readFileSetPaths called");
FileSetPathsDV fsp = new FileSetPathsDV(); FileSetPathsDV fsp = new FileSetPathsDV();
LOG.info("readFileSetPaths called");
List<String> fileSetPaths = new ArrayList<String>(); List<String> fileSetPaths = new ArrayList<String>();
fileSetPaths.add(Concessione.Paths.ABSTRACT_RELAZIONE); fileSetPaths.add(Concessione.Paths.ABSTRACT_RELAZIONE);
fileSetPaths.add(Concessione.Paths.RELAZIONE); fileSetPaths.add(Concessione.Paths.RELAZIONE);