Skip to content

Commit

Permalink
#550 Improved logging when publishing or updating
Browse files Browse the repository at this point in the history
  • Loading branch information
Possommi committed Nov 4, 2024
1 parent 7aa3873 commit 73705eb
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions common/src/main/java/de/uni_jena/thunibib/HISinOneCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ public static SysValue publish(String mcrid) {

SysValue publication = response.readEntity(conf.getResponseEntityClass());
if (publication.getId() == 0) {
LOGGER.error("MCRObject {} was not published at {} with id {}", mcrid, HIS_IN_ONE_BASE_URL,
publication.getId());
LOGGER.error("MCRObject {} was not published at {} with id {}", mcrid,
HIS_IN_ONE_BASE_URL + conf.getPath(), publication.getId());
return SysValue.ErroneousSysValue;
}

LOGGER.info("MCRObject {} published at {} with id {}", mcrid, HIS_IN_ONE_BASE_URL, publication.getId());
LOGGER.info("MCRObject {} published at {} with id {}", mcrid, HIS_IN_ONE_BASE_URL + conf.getPath(),
publication.getId());

// Update MCRObject
mcrObject.getService().addFlag(HISInOneServiceFlag.getName(), String.valueOf(publication.getId()));
Expand Down Expand Up @@ -103,12 +104,12 @@ public static SysValue update(String mcrid) {

SysValue p = response.readEntity(conf.getResponseEntityClass());
if (p.getId() == 0) {
LOGGER.error("MCRObject {} was not updated at {}({}) with id {}", mcrid, HIS_IN_ONE_BASE_URL,
conf.getPath(), p.getId());
LOGGER.error("MCRObject {} was not updated at {} with id {}", mcrid,
HIS_IN_ONE_BASE_URL + conf.getPath(), p.getId());
return SysValue.ErroneousSysValue;
}
LOGGER.info("MCRObject {} updated at {}({}) with id {} and new lockVersion {}", mcrid,
HIS_IN_ONE_BASE_URL, conf.getPath(), hisId, p.getLockVersion());
LOGGER.info("MCRObject {} updated at {} with id {} and new lockVersion {}", mcrid,
HIS_IN_ONE_BASE_URL + conf.getPath(), hisId, p.getLockVersion());
return p;
}
} catch (IOException e) {
Expand Down

0 comments on commit 73705eb

Please sign in to comment.