org.apache.felix.resolver.Logger类的使用及代码示例

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

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

Logger介绍

[英]This class mimics the standard OSGi LogService interface. An instance of this class is used by the framework for all logging. By default this class logs messages to standard out. The log level can be set to control the amount of logging performed, where a higher number results in more logging. A log level of zero turns off logging completely.

The log levels match those specified in the OSGi Log Service (i.e., 1 = error, 2 = warning, 3 = information, and 4 = debug). The default value is 1.

This class also uses the System Bundle's context to track log services and will use the highest ranking log service, if present, as a back end instead of printing to standard out. The class uses reflection to invoking the log service's method to avoid a dependency on the log interface.
[中]此类模仿标准OSGi LogService接口。这个类的一个实例被框架用于所有日志记录。默认情况下,此类将消息记录到标准输出。可以设置日志级别以控制执行的日志记录量,其中,更高的日志记录数会导致更多日志记录。日志级别为零将完全关闭日志记录。
日志级别与OSGi日志服务中指定的级别匹配(即,1=错误,2=警告,3=信息,4=调试)。默认值为1。
此类还使用系统包的上下文跟踪日志服务,并将使用排名最高的日志服务(如果存在)作为后端,而不是打印到标准输出。该类使用反射来调用日志服务的方法,以避免对日志接口的依赖。

代码示例

代码示例来源:origin: forge/roaster

public final void log(int level, String msg)
{
  _log(level, msg, null);
}

代码示例来源:origin: org.eclipse/osgi

private void _log(
  int level,
  String msg, Throwable throwable)
{
  if (m_logLevel >= level)
  {
    doLog(level, msg, throwable);
  }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

resource, pkgName,
        sourceBlame, blame);
    if (m_logger.isDebugEnabled())
      m_logger.debug(
          "Candidate permutation failed due to a conflict with a "
              + "fragment import; will try another if possible."
if (m_logger.isDebugEnabled())
  m_logger.debug("Candidate permutation failed due to a conflict between "
      + "an export and import; will try another if possible."
      + " (" + rethrow.getMessage() + ")");
  if (m_logger.isDebugEnabled())
    m_logger.debug("Candidate permutation failed due to a conflict between "
            + "imports; will try another if possible."
            + " (" + rethrow.getMessage() + ")"

代码示例来源:origin: biz.aQute.bnd/biz.aQute.resolve

public void start(BundleContext bc) throws Exception
{
  int logLevel = 4;
  if (bc.getProperty(LOG_LEVEL) != null)
  {
    try
    {
      logLevel = Integer.parseInt(bc.getProperty(LOG_LEVEL));
    }
    catch (NumberFormatException ex)
    {
      // Use default log level.
    }
  }
  bc.registerService(
    Resolver.class,
    new ResolverImpl(new Logger(logLevel)),
    null);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

m_logger.logUsesConstraintViolation(usesError.getKey(), usesError.getValue());

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

resource, pkgName,
        sourceBlame, blame);
    if (m_logger.isDebugEnabled())
      m_logger.debug(
          "Candidate permutation failed due to a conflict with a "
              + "fragment import; will try another if possible."
if (m_logger.isDebugEnabled())
  m_logger.debug("Candidate permutation failed due to a conflict between "
      + "an export and import; will try another if possible."
      + " (" + rethrow.getMessage() + ")");
  if (m_logger.isDebugEnabled())
    m_logger.debug("Candidate permutation failed due to a conflict between "
            + "imports; will try another if possible."
            + " (" + rethrow.getMessage() + ")"

代码示例来源:origin: apache/felix

public void start(BundleContext bc) throws Exception
{
  int logLevel = 4;
  if (bc.getProperty(LOG_LEVEL) != null)
  {
    try
    {
      logLevel = Integer.parseInt(bc.getProperty(LOG_LEVEL));
    }
    catch (NumberFormatException ex)
    {
      // Use default log level.
    }
  }
  bc.registerService(
    Resolver.class,
    new ResolverImpl(new Logger(logLevel)),
    null);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

m_logger.logUsesConstraintViolation(usesError.getKey(), usesError.getValue());

代码示例来源:origin: org.eclipse/osgi

public final void log(int level, String msg)
{
  _log(level, msg, null);
}

代码示例来源:origin: forge/roaster

resource, pkgName,
        sourceBlame, blame);
    if (m_logger.isDebugEnabled())
      m_logger.debug(
          "Candidate permutation failed due to a conflict with a "
              + "fragment import; will try another if possible."
  session.addPermutation(PermutationType.USES, permRef2.get());
if (m_logger.isDebugEnabled())
  m_logger.debug("Candidate permutation failed due to a conflict between "
      + "an export and import; will try another if possible."
      + " (" + rethrow.getMessage() + ")");
  if (m_logger.isDebugEnabled())
    m_logger.debug("Candidate permutation failed due to a conflict between "
            + "imports; will try another if possible."
            + " (" + rethrow.getMessage() + ")"

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

public void start(BundleContext bc) throws Exception
{
  int logLevel = 4;
  if (bc.getProperty(LOG_LEVEL) != null)
  {
    try
    {
      logLevel = Integer.parseInt(bc.getProperty(LOG_LEVEL));
    }
    catch (NumberFormatException ex)
    {
      // Use default log level.
    }
  }
  bc.registerService(
    Resolver.class,
    new ResolverImpl(new Logger(logLevel)),
    null);
}

代码示例来源:origin: forge/roaster

private void _log(
  int level,
  String msg, Throwable throwable)
{
  if (m_logLevel >= level)
  {
    doLog(level, msg, throwable);
  }
}

代码示例来源:origin: org.eclipse/osgi

m_logger.logUsesConstraintViolation(usesError.getKey(), usesError.getValue());

代码示例来源:origin: forge/roaster

public final void log(int level, String msg, Throwable throwable)
{
  _log(level, msg, throwable);
}

代码示例来源:origin: apache/felix

resource, pkgName,
        sourceBlame, blame);
    if (m_logger.isDebugEnabled())
      m_logger.debug(
          "Candidate permutation failed due to a conflict with a "
              + "fragment import; will try another if possible."
  session.addPermutation(PermutationType.USES, permRef2.get());
if (m_logger.isDebugEnabled())
  m_logger.debug("Candidate permutation failed due to a conflict between "
      + "an export and import; will try another if possible."
      + " (" + rethrow.getMessage() + ")");
  if (m_logger.isDebugEnabled())
    m_logger.debug("Candidate permutation failed due to a conflict between "
            + "imports; will try another if possible."
            + " (" + rethrow.getMessage() + ")"

代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi

private Map<Resource, List<Wire>> resolveDynamic() throws ResolutionException {
  return new ResolverImpl(new Logger(0), null).resolveDynamic(this, dynamicReq.getRevision().getWiring(), dynamicReq.getOriginal());
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi

private void _log(
  int level,
  String msg, Throwable throwable)
{
  if (m_logLevel >= level)
  {
    doLog(level, msg, throwable);
  }
}

代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox

m_logger.logUsesConstraintViolation(usesError.getKey(), usesError.getValue());

代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi

public final void log(int level, String msg)
{
  _log(level, msg, null);
}

代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd

resource, pkgName,
        sourceBlame, blame);
    if (m_logger.isDebugEnabled())
      m_logger.debug(
          "Candidate permutation failed due to a conflict with a "
              + "fragment import; will try another if possible."
  session.addPermutation(PermutationType.USES, permRef2.get());
if (m_logger.isDebugEnabled())
  m_logger.debug("Candidate permutation failed due to a conflict between "
      + "an export and import; will try another if possible."
      + " (" + rethrow.getMessage() + ")");
  if (m_logger.isDebugEnabled())
    m_logger.debug("Candidate permutation failed due to a conflict between "
            + "imports; will try another if possible."
            + " (" + rethrow.getMessage() + ")"

相关文章