@Override public void publish(LogRecord record) { zlg .level(JulMappings.mapLevel(record.getLevel())) .format("%s") .arg(Args.map(Args.ref(record), simpleFormatter::formatMessage)) .threw(record.getThrown()) .entrypoint(entrypoint) .log(); }
private void decideBallot(PendingBallot ballot) { zlg.t("Decided ballot for %s: resolution: %s", z -> z.arg(ballot::getProposal).arg(ballot::getResolution)); final Proposal proposal = ballot.getProposal(); final String xid = proposal.getXid(); final Object metadata = metadataEnabled ? new OutcomeMetadata(proposal.getTimestamp()) : null; final Outcome outcome = new Outcome(xid, ballot.getResolution(), ballot.getAbortReason(), ballot.getResponses(), metadata) .inResponseTo(proposal).withSource(groupId); pending.remove(xid); if (trackingEnabled) { additions.add(outcome); } action.appendOutcome(outcome, (id, x) -> { if (x == null) { ballot.getConfirmation().confirm(); } else { zlg.w("Error appending to ledger [message: %s]", z -> z.arg(outcome).threw(x)); } }); }
default void t(String summary, Throwable cause) { level(LogLevel.TRACE).message(summary).threw(cause).flush(entrypoint); }
default void d(String summary, Throwable cause) { level(LogLevel.DEBUG).message(summary).threw(cause).flush(entrypoint); }
default void i(String summary, Throwable cause) { level(LogLevel.INFO).message(summary).threw(cause).flush(entrypoint); }
default void w(String summary, Throwable cause) { level(LogLevel.WARN).message(summary).threw(cause).flush(entrypoint); }
default void e(String summary, Throwable cause) { level(LogLevel.ERROR).message(summary).threw(cause).flush(entrypoint); }
default void c(String summary, Throwable cause) { level(LogLevel.CONF).message(summary).threw(cause).flush(entrypoint); }
@Override public void log(Level level, String message, Throwable thrown) { zlg.level(JulMappings.mapLevel(level)).message(message).threw(thrown).entrypoint(entrypoint).log(); }
private void append(Vote vote) { action.appendVote(vote, (id, x) -> { if (x != null) zlg.w("Error appending to ledger [message: %s]", z -> z.arg(vote).threw(x)); }); }