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

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

本文整理了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

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

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

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

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

  1. /**
  2. * Public ctor.
  3. * @param response The resource
  4. * @param log Log message
  5. */
  6. public AuthException(final Response response, final String log) {
  7. super(response);
  8. Logger.debug(AuthException.class, "%s", log);
  9. }

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

  1. @Override
  2. protected void done() {
  3. Logger.debug(this, "Logging monitor thread interrupted");
  4. monitor.shutdown();
  5. }
  6. },

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

  1. @Override
  2. protected void done() {
  3. Logger.debug(this, "Logging monitor thread interrupted");
  4. monitor.shutdown();
  5. }
  6. },

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

  1. @Override
  2. public void close() {
  3. synchronized (this.monitors) {
  4. this.closed = true;
  5. }
  6. for (final Thread monitor : this.monitors) {
  7. if (monitor != null) {
  8. monitor.interrupt();
  9. Logger.debug(this, "monitor interrupted");
  10. }
  11. }
  12. this.process.destroy();
  13. Logger.debug(this, "underlying process destroyed");
  14. }

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

  1. @Override
  2. public void close() {
  3. synchronized (this.monitors) {
  4. this.closed = true;
  5. }
  6. for (final Thread monitor : this.monitors) {
  7. if (monitor != null) {
  8. monitor.interrupt();
  9. Logger.debug(this, "monitor interrupted");
  10. }
  11. }
  12. this.process.destroy();
  13. Logger.debug(this, "underlying process destroyed");
  14. }

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

  1. /**
  2. * Invalidate all.
  3. * @throws IOException If fails
  4. */
  5. public void invalidate() throws IOException {
  6. final File file = this.file("").getParentFile();
  7. if (file.exists()) {
  8. FileUtils.deleteDirectory(file);
  9. Logger.debug(this, "cache invalidated in %s", file);
  10. }
  11. }

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

  1. /**
  2. * Set servlet context from container, to be called by JAX-RS framework
  3. * because of {@link Context} annotation.
  4. * @param ctx The context
  5. */
  6. @Context
  7. public void setServletContext(@NotNull final ServletContext ctx) {
  8. final String name = ctx.getInitParameter(XslResolver.XSD_FOLDER);
  9. if (name != null) {
  10. this.folder = new File(name);
  11. Logger.debug(
  12. this,
  13. "#setServletContext(%s): XSD folder set to '%s'",
  14. ctx.getClass().getName(),
  15. this.folder
  16. );
  17. }
  18. }

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

  1. /**
  2. * Find "smart" class for the object.
  3. * @param object Object to wrap
  4. * @return Class to use
  5. */
  6. private static Constructor<?> type(final Object object) {
  7. for (final Class<?> iface : object.getClass().getInterfaces()) {
  8. try {
  9. return Class.forName(
  10. String.format("%s$Smart", iface.getName())
  11. ).getDeclaredConstructor(iface);
  12. } catch (final ClassNotFoundException ex) {
  13. Logger.debug(Smarts.class, "%s: %s", iface.getName(), ex);
  14. } catch (final NoSuchMethodException ex) {
  15. throw new IllegalStateException(ex);
  16. }
  17. }
  18. throw new IllegalStateException(
  19. String.format(
  20. "can't find Smart decorator for %s",
  21. object.getClass().getName()
  22. )
  23. );
  24. }

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

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

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

  1. @Override
  2. @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
  3. public ClassLoader classloader() {
  4. final List<URL> urls = new LinkedList<>();
  5. try {
  6. for (final String path : this.classpath()) {
  7. urls.add(
  8. new File(path).toURI().toURL()
  9. );
  10. }
  11. urls.add(this.classes.toURI().toURL());
  12. } catch (final MalformedURLException ex) {
  13. throw new IllegalStateException("Failed to build URL", ex);
  14. }
  15. final URLClassLoader loader = AccessController.doPrivileged(
  16. new AntEnvironment.PrivilegedClassLoader(urls)
  17. );
  18. for (final URL url : loader.getURLs()) {
  19. Logger.debug(this, "Classpath: %s", url);
  20. }
  21. return loader;
  22. }

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

  1. @Override
  2. public ClassLoader classloader() {
  3. final List<URL> urls = new LinkedList<>();
  4. for (final String path : this.classpath()) {
  5. try {
  6. urls.add(
  7. URI.create(String.format("file:///%s", path)).toURL()
  8. );
  9. } catch (final MalformedURLException ex) {
  10. throw new IllegalStateException("Failed to build URL", ex);
  11. }
  12. }
  13. final URLClassLoader loader = AccessController.doPrivilegedWithCombiner(
  14. new DefaultMavenEnvironment.PrivilegedClassLoader(urls)
  15. );
  16. for (final URL url : loader.getURLs()) {
  17. Logger.debug(this, "Classpath: %s", url);
  18. }
  19. return loader;
  20. }

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

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

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

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

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

  1. /**
  2. * Do we need filtering?
  3. * @return Do we need to transform to XHTML?
  4. */
  5. public boolean needsTransformation() {
  6. final UserAgent agent = new UserAgent(
  7. this.request.getHeader(HttpHeaders.USER_AGENT)
  8. );
  9. final TypesMatcher accept = new TypesMatcher(
  10. this.request.getHeader(HttpHeaders.ACCEPT)
  11. );
  12. // @checkstyle BooleanExpressionComplexity (1 line)
  13. final boolean needs = this.notEmpty() && this.containsXml()
  14. && !this.xmlDemanded(accept)
  15. && !this.xslAccepted(agent, accept);
  16. Logger.debug(
  17. this,
  18. // @checkstyle LineLength (1 line)
  19. "#needsTransformation('%s': '%[text]s'): User-Agent='%s', Accept='%s', %B",
  20. this.request.getRequestURI(), this.page,
  21. agent, accept, needs
  22. );
  23. return needs;
  24. }

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

  1. /**
  2. * Log one line.
  3. * @param level Level of logging
  4. * @param log Destination log
  5. * @param message Message to log
  6. * @param params Message parameters
  7. * @checkstyle ParameterNumberCheck (3 lines)
  8. */
  9. public static void log(final int level, final Object log,
  10. final String message, final Object... params) {
  11. if (level == Loggable.TRACE) {
  12. Logger.trace(log, message, params);
  13. } else if (level == Loggable.DEBUG) {
  14. Logger.debug(log, message, params);
  15. } else if (level == Loggable.INFO) {
  16. Logger.info(log, message, params);
  17. } else if (level == Loggable.WARN) {
  18. Logger.warn(log, message, params);
  19. } else if (level == Loggable.ERROR) {
  20. Logger.error(log, message, params);
  21. }
  22. }

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

  1. /**
  2. * Log one line.
  3. * @param level Level of logging
  4. * @param log Destination log
  5. * @param message Message to log
  6. * @param params Message parameters
  7. * @checkstyle ParameterNumberCheck (3 lines)
  8. */
  9. public static void log(final int level, final Object log,
  10. final String message, final Object... params) {
  11. if (level == Loggable.TRACE) {
  12. Logger.trace(log, message, params);
  13. } else if (level == Loggable.DEBUG) {
  14. Logger.debug(log, message, params);
  15. } else if (level == Loggable.INFO) {
  16. Logger.info(log, message, params);
  17. } else if (level == Loggable.WARN) {
  18. Logger.warn(log, message, params);
  19. } else if (level == Loggable.ERROR) {
  20. Logger.error(log, message, params);
  21. }
  22. }

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

  1. /**
  2. * Log one line using the logging level specified.
  3. * @param level The level of logging
  4. * @param source The source of the logging operation
  5. * @param msg The text message to be logged
  6. * @param args Optional arguments for string formatting
  7. * @since 0.8
  8. * @checkstyle ParameterNumber (4 lines)
  9. */
  10. public static void log(final Level level, final Object source,
  11. final String msg, final Object... args) {
  12. if (level.equals(Level.SEVERE)) {
  13. Logger.error(source, msg, args);
  14. } else if (level.equals(Level.WARNING)) {
  15. Logger.warn(source, msg, args);
  16. } else if (level.equals(Level.INFO) || level.equals(Level.CONFIG)) {
  17. Logger.info(source, msg, args);
  18. } else if (level.equals(Level.FINE) || level.equals(Level.ALL)) {
  19. Logger.debug(source, msg, args);
  20. } else if (level.equals(Level.FINER) || level.equals(Level.FINEST)) {
  21. Logger.trace(source, msg, args);
  22. }
  23. }

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

  1. /**
  2. * Log one line using the logging level specified.
  3. * @param level The level of logging
  4. * @param source The source of the logging operation
  5. * @param msg The text message to be logged
  6. * @param args Optional arguments for string formatting
  7. * @since 0.8
  8. * @checkstyle ParameterNumber (4 lines)
  9. */
  10. public static void log(final Level level, final Object source,
  11. final String msg, final Object... args) {
  12. if (level.equals(Level.SEVERE)) {
  13. Logger.error(source, msg, args);
  14. } else if (level.equals(Level.WARNING)) {
  15. Logger.warn(source, msg, args);
  16. } else if (level.equals(Level.INFO) || level.equals(Level.CONFIG)) {
  17. Logger.info(source, msg, args);
  18. } else if (level.equals(Level.FINE) || level.equals(Level.ALL)) {
  19. Logger.debug(source, msg, args);
  20. } else if (level.equals(Level.FINER) || level.equals(Level.FINEST)) {
  21. Logger.trace(source, msg, args);
  22. }
  23. }

相关文章