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

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

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

Logger.debug介绍

[英]Protocol one message, with DEBUG priority level.
[中]协议一消息,具有调试优先级。

代码示例

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

/**
 * Protocol one message, with {@code DEBUG} priority level.
 * @param source The source of the logging operation
 * @param msg The text message to be logged, with meta-tags
 * @since 0.7.11
 */
public static void debug(final Object source, final String msg) {
  Logger.debug(source, msg, Logger.EMPTY);
}

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

/**
 * Protocol one message, with {@code DEBUG} priority level.
 * @param source The source of the logging operation
 * @param msg The text message to be logged, with meta-tags
 * @since 0.7.11
 */
public static void debug(final Object source, final String msg) {
  Logger.debug(source, msg, Logger.EMPTY);
}

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

/**
 * Public ctor.
 * @param response The resource
 * @param log Log message
 */
public AuthException(final Response response, final String log) {
  super(response);
  Logger.debug(AuthException.class, "%s", log);
}

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

@Override
  protected void done() {
    Logger.debug(this, "Logging monitor thread interrupted");
    monitor.shutdown();
  }
},

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

@Override
  protected void done() {
    Logger.debug(this, "Logging monitor thread interrupted");
    monitor.shutdown();
  }
},

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

@Override
public void close() {
  synchronized (this.monitors) {
    this.closed = true;
  }
  for (final Thread monitor : this.monitors) {
    if (monitor != null) {
      monitor.interrupt();
      Logger.debug(this, "monitor interrupted");
    }
  }
  this.process.destroy();
  Logger.debug(this, "underlying process destroyed");
}

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

@Override
public void close() {
  synchronized (this.monitors) {
    this.closed = true;
  }
  for (final Thread monitor : this.monitors) {
    if (monitor != null) {
      monitor.interrupt();
      Logger.debug(this, "monitor interrupted");
    }
  }
  this.process.destroy();
  Logger.debug(this, "underlying process destroyed");
}

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

/**
 * Invalidate all.
 * @throws IOException If fails
 */
public void invalidate() throws IOException {
  final File file = this.file("").getParentFile();
  if (file.exists()) {
    FileUtils.deleteDirectory(file);
    Logger.debug(this, "cache invalidated in %s", file);
  }
}

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

/**
 * Set servlet context from container, to be called by JAX-RS framework
 * because of {@link Context} annotation.
 * @param ctx The context
 */
@Context
public void setServletContext(@NotNull final ServletContext ctx) {
  final String name = ctx.getInitParameter(XslResolver.XSD_FOLDER);
  if (name != null) {
    this.folder = new File(name);
    Logger.debug(
      this,
      "#setServletContext(%s): XSD folder set to '%s'",
      ctx.getClass().getName(),
      this.folder
    );
  }
}

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

/**
 * Find "smart" class for the object.
 * @param object Object to wrap
 * @return Class to use
 */
private static Constructor<?> type(final Object object) {
  for (final Class<?> iface : object.getClass().getInterfaces()) {
    try {
      return Class.forName(
        String.format("%s$Smart", iface.getName())
      ).getDeclaredConstructor(iface);
    } catch (final ClassNotFoundException ex) {
      Logger.debug(Smarts.class, "%s: %s", iface.getName(), ex);
    } catch (final NoSuchMethodException ex) {
      throw new IllegalStateException(ex);
    }
  }
  throw new IllegalStateException(
    String.format(
      "can't find Smart decorator for %s",
      object.getClass().getName()
    )
  );
}

代码示例来源:origin: com.qulice/qulice-findbugs

.getParentFile();
Logger.debug(this, "#jar(%s): found at %s", resource.getName(), file);
return file;

代码示例来源:origin: teamed/qulice

@Override
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
public ClassLoader classloader() {
  final List<URL> urls = new LinkedList<>();
  try {
    for (final String path : this.classpath()) {
      urls.add(
        new File(path).toURI().toURL()
      );
    }
    urls.add(this.classes.toURI().toURL());
  } catch (final MalformedURLException ex) {
    throw new IllegalStateException("Failed to build URL", ex);
  }
  final URLClassLoader loader = AccessController.doPrivileged(
    new AntEnvironment.PrivilegedClassLoader(urls)
  );
  for (final URL url : loader.getURLs()) {
    Logger.debug(this, "Classpath: %s", url);
  }
  return loader;
}

代码示例来源:origin: teamed/qulice

@Override
public ClassLoader classloader() {
  final List<URL> urls = new LinkedList<>();
  for (final String path : this.classpath()) {
    try {
      urls.add(
        URI.create(String.format("file:///%s", path)).toURL()
      );
    } catch (final MalformedURLException ex) {
      throw new IllegalStateException("Failed to build URL", ex);
    }
  }
  final URLClassLoader loader = AccessController.doPrivilegedWithCombiner(
    new DefaultMavenEnvironment.PrivilegedClassLoader(urls)
  );
  for (final URL url : loader.getURLs()) {
    Logger.debug(this, "Classpath: %s", url);
  }
  return loader;
}

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

private void downloadXUnitTest(String xUnitUrl) {
 try {
  String xUnitFullUrl = endpointDomain + xUnitUrl;
  Logger.debug(this, "XUnit report URL: '%s'", xUnitFullUrl);
  new ReportWriter().write(buildDirectory, xUnitFullUrl, "xunit-report.xml");
 } catch (IOException ioe) {
  Logger.error(this, "Failed to obtain xUnit report from: %s. Error: %s", xUnitUrl,
    ioe.getMessage());
 }
}

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

private void downloadXUnitTest(String xUnitUrl) {
 try {
  String xUnitFullUrl = endpointDomain + xUnitUrl;
  Logger.debug(this, "XUnit report URL: '%s'", xUnitFullUrl);
  new ReportWriter().write(buildDirectory, xUnitFullUrl, "xunit-report.xml");
 } catch (IOException ioe) {
  Logger.error(this, "Failed to obtain xUnit report from: %s. Error: %s", xUnitUrl,
    ioe.getMessage());
 }
}

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

/**
 * Do we need filtering?
 * @return Do we need to transform to XHTML?
 */
public boolean needsTransformation() {
  final UserAgent agent = new UserAgent(
    this.request.getHeader(HttpHeaders.USER_AGENT)
  );
  final TypesMatcher accept = new TypesMatcher(
    this.request.getHeader(HttpHeaders.ACCEPT)
  );
  // @checkstyle BooleanExpressionComplexity (1 line)
  final boolean needs = this.notEmpty() && this.containsXml()
    && !this.xmlDemanded(accept)
    && !this.xslAccepted(agent, accept);
  Logger.debug(
    this,
    // @checkstyle LineLength (1 line)
    "#needsTransformation('%s': '%[text]s'): User-Agent='%s', Accept='%s', %B",
    this.request.getRequestURI(), this.page,
    agent, accept, needs
  );
  return needs;
}

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

/**
 * Log one line.
 * @param level Level of logging
 * @param log Destination log
 * @param message Message to log
 * @param params Message parameters
 * @checkstyle ParameterNumberCheck (3 lines)
 */
public static void log(final int level, final Object log,
  final String message, final Object... params) {
  if (level == Loggable.TRACE) {
    Logger.trace(log, message, params);
  } else if (level == Loggable.DEBUG) {
    Logger.debug(log, message, params);
  } else if (level == Loggable.INFO) {
    Logger.info(log, message, params);
  } else if (level == Loggable.WARN) {
    Logger.warn(log, message, params);
  } else if (level == Loggable.ERROR) {
    Logger.error(log, message, params);
  }
}

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

/**
 * Log one line.
 * @param level Level of logging
 * @param log Destination log
 * @param message Message to log
 * @param params Message parameters
 * @checkstyle ParameterNumberCheck (3 lines)
 */
public static void log(final int level, final Object log,
  final String message, final Object... params) {
  if (level == Loggable.TRACE) {
    Logger.trace(log, message, params);
  } else if (level == Loggable.DEBUG) {
    Logger.debug(log, message, params);
  } else if (level == Loggable.INFO) {
    Logger.info(log, message, params);
  } else if (level == Loggable.WARN) {
    Logger.warn(log, message, params);
  } else if (level == Loggable.ERROR) {
    Logger.error(log, message, params);
  }
}

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

/**
 * Log one line using the logging level specified.
 * @param level The level of logging
 * @param source The source of the logging operation
 * @param msg The text message to be logged
 * @param args Optional arguments for string formatting
 * @since 0.8
 * @checkstyle ParameterNumber (4 lines)
 */
public static void log(final Level level, final Object source,
  final String msg, final Object... args) {
  if (level.equals(Level.SEVERE)) {
    Logger.error(source, msg, args);
  } else if (level.equals(Level.WARNING)) {
    Logger.warn(source, msg, args);
  } else if (level.equals(Level.INFO) || level.equals(Level.CONFIG)) {
    Logger.info(source, msg, args);
  } else if (level.equals(Level.FINE) || level.equals(Level.ALL)) {
    Logger.debug(source, msg, args);
  } else if (level.equals(Level.FINER) || level.equals(Level.FINEST)) {
    Logger.trace(source, msg, args);
  }
}

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

/**
 * Log one line using the logging level specified.
 * @param level The level of logging
 * @param source The source of the logging operation
 * @param msg The text message to be logged
 * @param args Optional arguments for string formatting
 * @since 0.8
 * @checkstyle ParameterNumber (4 lines)
 */
public static void log(final Level level, final Object source,
  final String msg, final Object... args) {
  if (level.equals(Level.SEVERE)) {
    Logger.error(source, msg, args);
  } else if (level.equals(Level.WARNING)) {
    Logger.warn(source, msg, args);
  } else if (level.equals(Level.INFO) || level.equals(Level.CONFIG)) {
    Logger.info(source, msg, args);
  } else if (level.equals(Level.FINE) || level.equals(Level.ALL)) {
    Logger.debug(source, msg, args);
  } else if (level.equals(Level.FINER) || level.equals(Level.FINEST)) {
    Logger.trace(source, msg, args);
  }
}

相关文章