org.ocpsoft.logging.Logger.isTraceEnabled()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(316)

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

Logger.isTraceEnabled介绍

暂无

代码示例

代码示例来源:origin: ocpsoft/rewrite

  1. public void trace(final String msg)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, msg, null);
  6. }
  7. }

代码示例来源:origin: ocpsoft/rewrite

  1. public void trace(final String msg, final Throwable t)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, msg, t);
  6. }
  7. }

代码示例来源:origin: org.ocpsoft.logging/logging-api

  1. public void trace(final String msg)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, msg, null);
  6. }
  7. }

代码示例来源:origin: org.ocpsoft.logging/logging-api

  1. public void trace(final String msg, final Throwable t)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, msg, t);
  6. }
  7. }

代码示例来源:origin: ocpsoft/rewrite

  1. public void trace(final String msg, final Object[] argArray)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, format(msg, argArray), null);
  6. }
  7. }

代码示例来源:origin: org.ocpsoft.logging/logging-api

  1. public void trace(final String msg, final Object arg1, final Object arg2)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, format(msg, new Object[] { arg1, arg2 }), null);
  6. }
  7. }

代码示例来源:origin: org.ocpsoft.logging/logging-api

  1. public void trace(final String msg, final Object[] argArray)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, format(msg, argArray), null);
  6. }
  7. }

代码示例来源:origin: ocpsoft/rewrite

  1. public void trace(final String msg, final Object arg)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, format(msg, new Object[] { arg }), null);
  6. }
  7. }

代码示例来源:origin: org.ocpsoft.logging/logging-api

  1. public void trace(final String msg, final Object arg)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, format(msg, new Object[] { arg }), null);
  6. }
  7. }

代码示例来源:origin: ocpsoft/rewrite

  1. public void trace(final String msg, final Object arg1, final Object arg2)
  2. {
  3. if (isTraceEnabled())
  4. {
  5. log(Level.TRACE, format(msg, new Object[] { arg1, arg2 }), null);
  6. }
  7. }

代码示例来源:origin: org.ocpsoft.rewrite/rewrite-api-el

  1. if (log.isTraceEnabled()) {
  2. log.trace("Service provider [{}] returned [{}] for class [{}]", new Object[] {
  3. resolver.getClass().getSimpleName(), beanName, clazz.getName()
  4. .toString();
  5. if (log.isTraceEnabled()) {
  6. log.debug("Creation of EL expression for component [{}] of class [{}] successful: {}", new Object[] {
  7. component, clazz.getName(), el

代码示例来源:origin: ocpsoft/rewrite

  1. /**
  2. * Process one {@link AnnotatedElement} of the class.
  3. */
  4. private void visit(AnnotatedElement element, ClassContext context)
  5. {
  6. List<AnnotationHandler<Annotation>> elementHandlers = new ArrayList<AnnotationHandler<Annotation>>();
  7. // check if any of the handlers is responsible
  8. for (AnnotationHandler<Annotation> handler : handlerList)
  9. {
  10. // each annotation on the element may be interesting for us
  11. for (Annotation annotation : element.getAnnotations())
  12. {
  13. if (handler.handles().equals(annotation.annotationType()))
  14. {
  15. elementHandlers.add(handler);
  16. }
  17. }
  18. }
  19. if (!elementHandlers.isEmpty())
  20. {
  21. if (log.isTraceEnabled())
  22. {
  23. log.trace("Executing handler chain on " + element + ": " + elementHandlers);
  24. }
  25. // execute the handler chain
  26. new HandlerChainImpl(context, element, elementHandlers).proceed();
  27. }
  28. }

代码示例来源:origin: ocpsoft/rewrite

  1. /**
  2. * Process one {@link AnnotatedElement} of the class.
  3. */
  4. private void visit(AnnotatedElement element, ClassContext context)
  5. {
  6. List<AnnotationHandler<Annotation>> elementHandlers = new ArrayList<AnnotationHandler<Annotation>>();
  7. // check if any of the handlers is responsible
  8. for (AnnotationHandler<Annotation> handler : handlerList)
  9. {
  10. // each annotation on the element may be interesting for us
  11. for (Annotation annotation : element.getAnnotations())
  12. {
  13. if (handler.handles().equals(annotation.annotationType()))
  14. {
  15. elementHandlers.add(handler);
  16. }
  17. }
  18. }
  19. if (!elementHandlers.isEmpty())
  20. {
  21. if (log.isTraceEnabled())
  22. {
  23. log.trace("Executing handler chain on " + element + ": " + elementHandlers);
  24. }
  25. // execute the handler chain
  26. new HandlerChainImpl(context, element, elementHandlers).proceed();
  27. }
  28. }

代码示例来源:origin: ocpsoft/rewrite

  1. @Override
  2. public void process(FieldContext context, Matches annotation, HandlerChain chain)
  3. {
  4. // obtain the parameter for the current field
  5. ParameterBuilder<?> parameterBuilder =
  6. (ParameterBuilder<?>) context.get(ParameterBuilder.class);
  7. if (parameterBuilder == null) {
  8. throw new IllegalStateException("Cound not find any binding for field: " +
  9. context.getJavaField().getName());
  10. }
  11. // add a corresponding RegexConstraint
  12. String expr = annotation.value();
  13. parameterBuilder.constrainedBy(new RegexConstraint(expr));
  14. if (log.isTraceEnabled()) {
  15. log.trace("Parameter [{}] has been constrained by [{}]", parameterBuilder.getName(), expr);
  16. }
  17. // proceed with the chain
  18. chain.proceed();
  19. }

代码示例来源:origin: ocpsoft/rewrite

  1. @Override
  2. public void process(FieldContext context, Matches annotation, HandlerChain chain)
  3. {
  4. // obtain the parameter for the current field
  5. ParameterBuilder<?> parameterBuilder =
  6. (ParameterBuilder<?>) context.get(ParameterBuilder.class);
  7. if (parameterBuilder == null) {
  8. throw new IllegalStateException("Cound not find any binding for field: " +
  9. context.getJavaField().getName());
  10. }
  11. // add a corresponding RegexConstraint
  12. String expr = annotation.value();
  13. parameterBuilder.constrainedBy(new RegexConstraint(expr));
  14. if (log.isTraceEnabled()) {
  15. log.trace("Parameter [{}] has been constrained by [{}]", parameterBuilder.getName(), expr);
  16. }
  17. // proceed with the chain
  18. chain.proceed();
  19. }

代码示例来源:origin: ocpsoft/rewrite

  1. break;
  2. case TRACE:
  3. if (log.isTraceEnabled())
  4. log.trace(buildLogOutput(event).toString());
  5. break;

代码示例来源:origin: ocpsoft/rewrite

  1. @Override
  2. public void perform(Rewrite event, EvaluationContext context)
  3. {
  4. String message = messageBuilder.build(event, context);
  5. switch (level)
  6. {
  7. case TRACE:
  8. if (log.isTraceEnabled())
  9. log.trace(message);
  10. break;
  11. case DEBUG:
  12. if (log.isDebugEnabled())
  13. log.debug(message);
  14. break;
  15. case INFO:
  16. if (log.isInfoEnabled())
  17. log.info(message);
  18. break;
  19. case WARN:
  20. if (log.isWarnEnabled())
  21. log.warn(message);
  22. break;
  23. case ERROR:
  24. if (log.isErrorEnabled())
  25. log.error(message);
  26. break;
  27. default:
  28. break;
  29. }
  30. }

代码示例来源:origin: ocpsoft/rewrite

  1. @Override
  2. public void perform(Rewrite event, EvaluationContext context)
  3. {
  4. String message = messageBuilder.build(event, context);
  5. switch (level)
  6. {
  7. case TRACE:
  8. if (log.isTraceEnabled())
  9. log.trace(message);
  10. break;
  11. case DEBUG:
  12. if (log.isDebugEnabled())
  13. log.debug(message);
  14. break;
  15. case INFO:
  16. if (log.isInfoEnabled())
  17. log.info(message);
  18. break;
  19. case WARN:
  20. if (log.isWarnEnabled())
  21. log.warn(message);
  22. break;
  23. case ERROR:
  24. if (log.isErrorEnabled())
  25. log.error(message);
  26. break;
  27. default:
  28. break;
  29. }
  30. }

代码示例来源:origin: windup/windup

  1. @Override
  2. public void perform(Rewrite event, EvaluationContext context)
  3. {
  4. // Quite verbose. TODO: ... See https://github.com/ocpsoft/logging/issues/1
  5. switch (level)
  6. {
  7. case TRACE:
  8. if (log.isTraceEnabled())
  9. log.trace(messageBuilder.build(event, context));
  10. break;
  11. case DEBUG:
  12. if (log.isDebugEnabled())
  13. log.debug(messageBuilder.build(event, context));
  14. break;
  15. case INFO:
  16. if (log.isInfoEnabled())
  17. log.info(messageBuilder.build(event, context));
  18. break;
  19. case WARN:
  20. if (log.isWarnEnabled())
  21. log.warn(messageBuilder.build(event, context));
  22. break;
  23. case ERROR:
  24. if (log.isErrorEnabled())
  25. log.error(messageBuilder.build(event, context));
  26. break;
  27. }
  28. }

代码示例来源:origin: org.jboss.windup.config/windup-config-api

  1. @Override
  2. public void perform(Rewrite event, EvaluationContext context)
  3. {
  4. // Quite verbose. TODO: ... See https://github.com/ocpsoft/logging/issues/1
  5. switch (level)
  6. {
  7. case TRACE:
  8. if (log.isTraceEnabled())
  9. log.trace(messageBuilder.build(event, context));
  10. break;
  11. case DEBUG:
  12. if (log.isDebugEnabled())
  13. log.debug(messageBuilder.build(event, context));
  14. break;
  15. case INFO:
  16. if (log.isInfoEnabled())
  17. log.info(messageBuilder.build(event, context));
  18. break;
  19. case WARN:
  20. if (log.isWarnEnabled())
  21. log.warn(messageBuilder.build(event, context));
  22. break;
  23. case ERROR:
  24. if (log.isErrorEnabled())
  25. log.error(messageBuilder.build(event, context));
  26. break;
  27. }
  28. }

相关文章