VersionedMetaData: Emit debug log after update has been committed

Log the commit message and the revision that was created.

Also update the existing log to put the message in quotes, and
include the name of the project.

Change-Id: Id8c8eea622f54600a822d14abdd4da2db5d727b1
This commit is contained in:
David Pursehouse
2020-02-21 17:43:53 +09:00
parent ac9a6a8b9e
commit 6b699f79be

View File

@@ -409,7 +409,7 @@ public abstract class VersionedMetaData {
// read the subject line and use it as reflog message
ru.setRefLogMessage("commit: " + reader.readLine(), true);
}
logger.atFine().log("Saving commit: %s", message.trim());
logger.atFine().log("Saving commit '%s' on project '%s'", message.trim(), projectName);
inserter.flush();
RefUpdate.Result result = ru.update();
switch (result) {
@@ -417,6 +417,9 @@ public abstract class VersionedMetaData {
case FAST_FORWARD:
revision = rw.parseCommit(ru.getNewObjectId());
update.fireGitRefUpdatedEvent(ru);
logger.atFine().log(
"Saved commit '%s' as revision '%s' on project '%s'",
message.trim(), revision.name(), projectName);
return revision;
case LOCK_FAILURE:
throw new LockFailureException(errorMsg(ru, db.getDirectory()), ru);