com.jcabi.log.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(232)

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

Logger.warn介绍

[英]Protocol one message, with WARN priority level.
[中]协议一消息,具有警告优先级。

代码示例

代码示例来源:origin: com.jcabi/jcabi-log

  1. @Override
  2. public void uncaughtException(final Thread thread,
  3. final Throwable throwable) {
  4. Logger.warn(this, "%[exception]s", throwable);
  5. }
  6. }

代码示例来源:origin: jcabi/jcabi-log

  1. /**
  2. * Protocol one message, with {@code WARN} priority level.
  3. * @param source The source of the logging operation
  4. * @param msg The text message to be logged
  5. * @since 0.7.11
  6. */
  7. public static void warn(final Object source, final String msg) {
  8. Logger.warn(source, msg, Logger.EMPTY);
  9. }

代码示例来源:origin: com.jcabi/jcabi-log

  1. /**
  2. * Protocol one message, with {@code WARN} priority level.
  3. * @param source The source of the logging operation
  4. * @param msg The text message to be logged
  5. * @since 0.7.11
  6. */
  7. public static void warn(final Object source, final String msg) {
  8. Logger.warn(source, msg, Logger.EMPTY);
  9. }

代码示例来源:origin: jcabi/jcabi-log

  1. @Override
  2. public void uncaughtException(final Thread thread,
  3. final Throwable throwable) {
  4. Logger.warn(this, "%[exception]s", throwable);
  5. }
  6. }

代码示例来源:origin: com.rexsl/rexsl

  1. @Override
  2. public void setAttribute(final String str, final Object obj) {
  3. Logger.warn(
  4. this, "#setAttribute('%s', ..) ignored by %s",
  5. str, this.getClass().getSimpleName()
  6. );
  7. }

代码示例来源:origin: com.rexsl/rexsl

  1. @Override
  2. public void removeAttribute(final String str) {
  3. Logger.warn(
  4. this, "#removeAttribute('%s') ignored by %s",
  5. str, this.getClass().getSimpleName()
  6. );
  7. }

代码示例来源:origin: com.jcabi/jcabi-manifests

  1. @Override
  2. public Collection<InputStream> fetch() throws IOException {
  3. final URL main = this.ctx.getResource("/META-INF/MANIFEST.MF");
  4. final Collection<InputStream> streams = new ArrayList<InputStream>(1);
  5. if (main == null) {
  6. Logger.warn(this, "MANIFEST.MF not found in WAR package");
  7. } else {
  8. streams.add(main.openStream());
  9. }
  10. return streams;
  11. }

代码示例来源:origin: jcabi/jcabi-manifests

  1. @Override
  2. public Collection<InputStream> fetch() throws IOException {
  3. final URL main = this.ctx.getResource("/META-INF/MANIFEST.MF");
  4. final Collection<InputStream> streams = new ArrayList<InputStream>(1);
  5. if (main == null) {
  6. Logger.warn(this, "MANIFEST.MF not found in WAR package");
  7. } else {
  8. streams.add(main.openStream());
  9. }
  10. return streams;
  11. }

代码示例来源:origin: jcabi/jcabi-github

  1. @Override
  2. public void remove() throws IOException {
  3. try {
  4. this.origin.remove();
  5. } catch (final AssertionError ex) {
  6. Logger.warn(this, "Failed to remove comment: %[exception]s", ex);
  7. }
  8. }

代码示例来源:origin: jcabi/jcabi-github

  1. @Override
  2. public void patch(final JsonObject json) throws IOException {
  3. try {
  4. this.origin.patch(json);
  5. } catch (final AssertionError ex) {
  6. Logger.warn(this, "Failed to path comment: %[exception]s", ex);
  7. }
  8. }

代码示例来源:origin: jcabi/jcabi-github

  1. @Override
  2. public void patch(final JsonObject json) throws IOException {
  3. try {
  4. this.origin.patch(json);
  5. } catch (final AssertionError ex) {
  6. Logger.warn(this, "failed to patch issue: %[exception]s", ex);
  7. }
  8. }

代码示例来源:origin: com.rexsl/rexsl

  1. @Override
  2. @NotNull
  3. public String render(@NotNull final String defect) {
  4. Logger.warn(this, "#render(..): %s", this.message);
  5. return Logger.format(
  6. "<html><body><pre>%s\n\n%s</pre></body></html>",
  7. this.message,
  8. defect
  9. );
  10. }
  11. }

代码示例来源:origin: com.jcabi/jcabi-xml

  1. @Override
  2. public void warning(final TransformerException warning) {
  3. Logger.warn(
  4. this, "#warning(): %s",
  5. warning.getMessageAndLocation()
  6. );
  7. this.errors.add(warning.getMessageAndLocation());
  8. }

代码示例来源:origin: jcabi/jcabi-xml

  1. @Override
  2. public void warning(final TransformerException warning) {
  3. Logger.warn(
  4. this, "#warning(): %s",
  5. warning.getMessageAndLocation()
  6. );
  7. this.errors.add(warning.getMessageAndLocation());
  8. }

代码示例来源:origin: com.cognifide.aet/client-core

  1. @Override
  2. public void process() throws AETException {
  3. Logger.warn(this, "Received unexpected status: %s. Message: %s.",
  4. suiteStatusResult.getStatus(), suiteStatusResult.getMessage());
  5. }
  6. }

代码示例来源:origin: Cognifide/aet

  1. @Override
  2. public void process() throws AETException {
  3. Logger.warn(this, "Received unexpected status: %s. Message: %s.",
  4. suiteStatusResult.getStatus(), suiteStatusResult.getMessage());
  5. }
  6. }

代码示例来源:origin: com.cognifide.aet/client-core

  1. @Override
  2. public void process() throws AETException {
  3. Logger.warn(this, "Received processing error status: %s. Message: %s.",
  4. suiteStatusResult.getStatus(), suiteStatusResult.getMessage());
  5. }
  6. }

代码示例来源:origin: Cognifide/aet

  1. @Override
  2. public void process() throws AETException {
  3. Logger.warn(this, "Received processing error status: %s. Message: %s.",
  4. suiteStatusResult.getStatus(), suiteStatusResult.getMessage());
  5. }
  6. }

代码示例来源:origin: jcabi/jcabi-github

  1. @Override
  2. public JsonObject json() throws IOException {
  3. JsonObject json;
  4. try {
  5. json = this.origin.json();
  6. } catch (final AssertionError ex) {
  7. json = new MkGithub().randomRepo()
  8. .issues().create("", "").json();
  9. Logger.warn(this, "failed to fetch issue: %[exception]s", ex);
  10. }
  11. return json;
  12. }

代码示例来源:origin: jcabi/jcabi-github

  1. @Override
  2. public Comment post(final String text) throws IOException {
  3. Comment cmt;
  4. try {
  5. cmt = this.origin.post(text);
  6. } catch (final AssertionError ex) {
  7. Logger.warn(this, "Failed to post to GitHub: %[exception]s", ex);
  8. cmt = new MkGithub().randomRepo()
  9. .issues().create("", "")
  10. .comments().post(text);
  11. }
  12. return cmt;
  13. }
  14. }

相关文章