本文整理了Java中org.ocpsoft.logging.Logger
类的一些代码示例,展示了Logger
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger
类的具体详情如下:
包路径:org.ocpsoft.logging.Logger
类名称:Logger
[英]Class to create log messages.
[中]类来创建日志消息。
代码示例来源:origin: ocpsoft/rewrite
@Override
public void perform(Rewrite event, EvaluationContext context)
{
String message = messageBuilder.build(event, context);
switch (level)
{
case TRACE:
if (log.isTraceEnabled())
log.trace(message);
break;
case DEBUG:
if (log.isDebugEnabled())
log.debug(message);
break;
case INFO:
if (log.isInfoEnabled())
log.info(message);
break;
case WARN:
if (log.isWarnEnabled())
log.warn(message);
break;
case ERROR:
if (log.isErrorEnabled())
log.error(message);
break;
default:
break;
}
}
代码示例来源:origin: org.ocpsoft.logging/logging-api
/**
* Create a {@link Logger} instance for a specific class
*
* @param clazz The class to create the log for
* @return The {@link Logger} instance
*/
public static Logger getLogger(final Class<?> clazz)
{
return getLogger(clazz.getName());
}
代码示例来源:origin: ocpsoft/rewrite
public void trace(final String msg)
{
if (isTraceEnabled())
{
log(Level.TRACE, msg, null);
}
}
代码示例来源:origin: ocpsoft/rewrite
public void info(final String msg, final Object[] argArray)
{
if (isInfoEnabled())
{
log(Level.INFO, format(msg, argArray), null);
}
}
代码示例来源:origin: ocpsoft/rewrite
public void info(final String msg)
{
if (isInfoEnabled())
{
log(Level.INFO, msg, null);
}
}
代码示例来源:origin: ocpsoft/rewrite
protected void closeQuietly(Closeable closeable)
{
try
{
closeable.close();
}
catch (IOException e)
{
logger.warn(e.getMessage(), e);
}
}
代码示例来源:origin: org.ocpsoft.rewrite/rewrite-integration-spring
@Override
public <T> void enrich(final T service)
{
SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(service);
if (log.isDebugEnabled())
log.debug("Enriched instance of service [" + service.getClass().getName() + "]");
}
代码示例来源:origin: ocpsoft/rewrite
private void checkConfLocal(final Conf conf)
{
if (conf.isOk() && conf.isEngineEnabled()) {
urlRewriter = new UrlRewriter(conf);
log.debug("Tuckey UrlRewriteFilter configuration loaded (Status: OK)");
}
else {
if (!conf.isOk()) {
log.error("Tuckey UrlRewriteFilter configuration failed (Status: ERROR)");
}
if (!conf.isEngineEnabled()) {
log.warn("Tuckey UrlRewriteFilter engine explicitly disabled in configuration");
}
if (urlRewriter != null) {
log.debug("Tuckey UrlRewriteFilter configuration unloaded");
urlRewriter = null;
}
}
}
代码示例来源:origin: org.ocpsoft.rewrite/rewrite-impl
@Override
public Object getInstance(Class<?> type)
{
Object result = null;
try {
result = type.newInstance();
}
catch (Exception e) {
log.debug("Could not create instance of type [" + type.getName() + "] through reflection.", e);
}
return result;
}
代码示例来源:origin: ocpsoft/rewrite
if (log.isDebugEnabled())
log.debug("Processing JAR file: " + jarUrl.toString());
log.error("Failed to read JAR file: " + jarUrl.toString(), e);
代码示例来源:origin: ocpsoft/rewrite
if (log.isTraceEnabled()) {
log.trace("Service provider [{}] returned [{}] for class [{}]", new Object[] {
resolver.getClass().getSimpleName(), beanName, clazz.getName()
});
.toString();
if (log.isTraceEnabled()) {
log.debug("Creation of EL expression for component [{}] of class [{}] successful: {}", new Object[] {
component, clazz.getName(), el
});
代码示例来源:origin: ocpsoft/rewrite
/**
* Process one {@link AnnotatedElement} of the class.
*/
private void visit(AnnotatedElement element, ClassContext context)
{
List<AnnotationHandler<Annotation>> elementHandlers = new ArrayList<AnnotationHandler<Annotation>>();
// check if any of the handlers is responsible
for (AnnotationHandler<Annotation> handler : handlerList)
{
// each annotation on the element may be interesting for us
for (Annotation annotation : element.getAnnotations())
{
if (handler.handles().equals(annotation.annotationType()))
{
elementHandlers.add(handler);
}
}
}
if (!elementHandlers.isEmpty())
{
if (log.isTraceEnabled())
{
log.trace("Executing handler chain on " + element + ": " + elementHandlers);
}
// execute the handler chain
new HandlerChainImpl(context, element, elementHandlers).proceed();
}
}
代码示例来源:origin: org.ocpsoft.logging/logging-api
public void debug(final String msg, final Object arg)
{
if (isDebugEnabled())
{
log(Level.DEBUG, format(msg, new Object[] { arg }), null);
}
}
代码示例来源:origin: ocpsoft/rewrite
log.debug("Error", e);
log.error("unable to find urlrewrite conf file at " + confPath);
log.error("unloading existing conf");
urlRewriter = null;
代码示例来源:origin: org.jboss.windup.web.addons/windup-web-support-impl
private static List<String> findPaths(Path path, boolean relativeOnly)
{
List<String> results = new ArrayList<>();
results.add(path.normalize().toAbsolutePath().toString());
if (Files.isDirectory(path))
{
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path))
{
for (Path child : directoryStream)
{
results.addAll(findPaths(child, relativeOnly));
}
}
catch (IOException e)
{
Logger.getLogger(PackageDiscoveryServiceImpl.class).warn("Could not read file: " + path + " due to: " + e.getMessage());
}
}
else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString()))
{
results.addAll(ZipUtil.scanZipFile(path, relativeOnly));
}
return results;
}
}
代码示例来源:origin: org.ocpsoft.logging/logging-api
public void trace(final String msg, final Object arg)
{
if (isTraceEnabled())
{
log(Level.TRACE, format(msg, new Object[] { arg }), null);
}
}
代码示例来源:origin: ocpsoft/rewrite
public class AnnotationConfigProvider extends HttpConfigurationProvider
private final Logger log = Logger.getLogger(AnnotationConfigProvider.class);
log.debug("Annotation scanning is disabled!");
return null;
代码示例来源:origin: org.ocpsoft.logging/logging-api
public void debug(final String msg)
{
if (isDebugEnabled())
{
log(Level.DEBUG, msg, null);
}
}
代码示例来源:origin: org.ocpsoft.rewrite/rewrite-integration-faces
public RewritePhaseListener()
{
log.info(RewritePhaseListener.class.getSimpleName() + " starting up.");
}
代码示例来源:origin: org.ocpsoft.rewrite/rewrite-api-el
private static Object executeProviderCallable(Rewrite event, EvaluationContext context,
ProviderCallable<Object> providerCallable)
{
List<Exception> exceptions = new ArrayList<Exception>();
for (ExpressionLanguageProvider provider : getProviders()) {
try
{
return providerCallable.call(event, context, provider);
}
catch (RuntimeException e) {
throw e;
}
catch (Exception e)
{
exceptions.add(e);
}
}
for (Exception exception : exceptions) {
log.error("DEFERRED EXCEPTION", exception);
}
throw new RewriteException("No registered " + ExpressionLanguageProvider.class.getName()
+ " could handle the Expression [" + providerCallable.getExpression() + "]");
}
内容来源于网络,如有侵权,请联系作者删除!