com.obsidiandynamics.zerolog.Zlg类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中com.obsidiandynamics.zerolog.Zlg类的一些代码示例,展示了Zlg类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zlg类的具体详情如下:
包路径:com.obsidiandynamics.zerolog.Zlg
类名称:Zlg

Zlg介绍

暂无

代码示例

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-core

static ZlgBuilder forClass(Class<?> cls) {
 return forName(cls.getName());
}

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-core

default void c(String format, Consumer<LogChain> logChainConsumer) {
 level(LogLevel.CONF).format(format).flush(logChainConsumer);
}

代码示例来源:origin: com.obsidiandynamics.meteor/meteor-core

@Override
 public void onException(String summary, Throwable error) {
  zlgSupplier.get().w(summary, error);
 }
}

代码示例来源:origin: com.obsidiandynamics.jackdaw/jackdaw-core

try {
 entry.getValue().get();
 zlg.d("Deleted consumer group %s", z -> z.arg(entry::getKey));
 deleted.add(entry.getKey());
} catch (ExecutionException e) {
 if (e.getCause() instanceof GroupNotEmptyException) {
  zlg.d("Group %s not empty (will be deleted later)", z -> z.arg(entry::getKey));
  deleted.add(entry.getKey());
 } else if (e.getCause() instanceof GroupIdNotFoundException) {
  zlg.d("Group %s not found", z -> z.arg(entry::getKey));
 }  else {
  throw e;

代码示例来源:origin: com.obsidiandynamics.blackstrom/blackstrom-core

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));
  }
 });
}

代码示例来源:origin: com.obsidiandynamics.blackstrom/blackstrom-core

public void onVote(MessageContext context, Vote vote) {
 synchronized (messageLock) {
  final PendingBallot ballot = pending.get(vote.getXid());
  if (ballot != null) {
   zlg.t("Received %s", z -> z.arg(vote));
   final boolean decided = ballot.castVote(zlg, vote);
   if (decided) {
    decideBallot(ballot);
   }
  } else {
   zlg.t("Missing pending ballot for vote %s", z -> z.arg(vote));
  }
 }
}

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-bridge-hazelcast

@Override
 public boolean isLoggable(Level level) {
  return zlg.isEnabled(JulMappings.mapLevel(level));
 }
}

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-core

static ZlgBuilder forDeclaringClass() {
 return forClass(Stacks.classForDepth(2));
}

代码示例来源:origin: com.obsidiandynamics.jackdaw/jackdaw-core

try {
 entry.getValue().get();
 zlg.d("Created topic %s", z -> z.arg(entry::getKey));
 created.add(entry.getKey());
} catch (ExecutionException e) {
 if (e.getCause() instanceof TopicExistsException) {
  zlg.d("Topic %s already exists", z -> z.arg(entry::getKey));
 } else {
  throw e;

代码示例来源:origin: com.obsidiandynamics.blackstrom/blackstrom-core

public void onProposal(MessageContext context, Proposal proposal) {
 synchronized (messageLock) {
  final PendingBallot newBallot = new PendingBallot(proposal);
  final PendingBallot existingBallot = pending.put(proposal.getXid(), newBallot);
  if (existingBallot != null) {
   zlg.t("Skipping redundant %s (ballot already pending)", z -> z.arg(proposal));
   pending.put(proposal.getXid(), existingBallot);
   return;
  } else {
   newBallot.setConfirmation(context.begin(proposal));
  }
 }
 
 zlg.t("Initiating ballot for %s", z -> z.arg(proposal));
}

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-core

default void d(String format, Consumer<LogChain> logChainConsumer) {
 level(LogLevel.DEBUG).format(format).flush(logChainConsumer);
}

代码示例来源:origin: com.obsidiandynamics.jackdaw/jackdaw-core

try {
 entry.getValue().get();
 zlg.d("Deleted topic %s", z -> z.arg(entry::getKey));
 deleted.add(entry.getKey());
} catch (ExecutionException e) {
 if (e.getCause() instanceof UnknownTopicOrPartitionException) {
  zlg.d("Topic %s does not exist", z -> z.arg(entry::getKey));
 } else {
  throw e;

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-bridge-jul

public ZlgHandler() {
 this(Zlg.forName("").get());
}

代码示例来源:origin: com.obsidiandynamics.blackstrom/blackstrom-core

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));
 });
}

代码示例来源:origin: com.obsidiandynamics.blackstrom/blackstrom-core

boolean castVote(Zlg zlg, Vote vote) {
 final Response response = vote.getResponse();
 final Response existing = responses.put(response.getCohort(), response);
 if (existing != null) {
  zlg.t("Skipping redundant %s (already cast in current ballot)", z -> z.arg(vote));
  responses.put(existing.getCohort(), existing);
  return false;
 }
 
 final Intent intent = response.getIntent();
 if (intent == Intent.REJECT) {
  resolution = Resolution.ABORT;
  abortReason = AbortReason.REJECT;
  return true;
 } else if (intent == Intent.TIMEOUT) {
  resolution = Resolution.ABORT;
  abortReason = AbortReason.EXPLICIT_TIMEOUT;
  return true;
 } else if (hasLapsed(vote)) {
  resolution = Resolution.ABORT;
  abortReason = AbortReason.IMPLICIT_TIMEOUT;
  return true;
 }
 
 return allResponsesPresent();
}

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-core

default void i(String format, Consumer<LogChain> logChainConsumer) {
 level(LogLevel.INFO).format(format).flush(logChainConsumer);
}

代码示例来源:origin: com.obsidiandynamics.blackstrom/blackstrom-core

private void timeoutCohort(Proposal proposal, String cohort) {
 zlg.d("Timed out %s for cohort %s", z -> z.arg(proposal).arg(cohort));
 append(new Vote(proposal.getXid(), new Response(cohort, Intent.TIMEOUT, null))
     .inResponseTo(proposal).withSource(groupId));
}

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-bridge-hazelcast

@Override
 public ILogger createLogger(String name) {
  return new ZlgLogger(Zlg.forName(name).withConfigService(configService).get());
 }
}

代码示例来源:origin: com.obsidiandynamics.meteor/meteor-core

final long safetyMargin = (long) (config.getStreamConfig().getHeapCapacity() * safetyMarginFrac);
final long ffNextReadOffset = headSeq + safetyMargin;
config.getZlg().w("Sequence %,d was stale (head already at %,d), fast-forwarding to %,d", 
         z -> z.arg(nextReadOffset).arg(headSeq).arg(ffNextReadOffset));
nextReadOffset = ffNextReadOffset;

代码示例来源:origin: com.obsidiandynamics.zerolog/zerolog-core

default void e(Object message) { 
 level(LogLevel.ERROR).message(message).flush(entrypoint); 
}

相关文章