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