当前位置: 首页>>代码示例>>Java>>正文


Java TreeLogger.Type方法代码示例

本文整理汇总了Java中com.google.gwt.core.ext.TreeLogger.Type方法的典型用法代码示例。如果您正苦于以下问题:Java TreeLogger.Type方法的具体用法?Java TreeLogger.Type怎么用?Java TreeLogger.Type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.core.ext.TreeLogger的用法示例。


在下文中一共展示了TreeLogger.Type方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setLowestLogLevel

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
/**
 * Sets the loggable types based on a lowest log level.
 */
public void setLowestLogLevel(TreeLogger.Type lowestLogLevel) {
  loggableTypes.clear();
  for (Type type : TreeLogger.Type.values()) {
    if (!type.isLowerPriorityThan(lowestLogLevel)) {
      loggableTypes.add(type);
    }
  }
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:12,代码来源:UnitTestTreeLogger.java

示例2: UnitTestTreeLogger

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public UnitTestTreeLogger(List<LogEntry> expectedEntries, EnumSet<TreeLogger.Type> loggableTypes) {
  this.expectedEntries.addAll(expectedEntries);
  this.loggableTypes = loggableTypes;

  // Sanity check that all expected entries are actually loggable.
  for (LogEntry entry : expectedEntries) {
    Type type = entry.getType();
    Assert.assertTrue("Cannot expect an entry of a non-loggable type!", isLoggable(type));
    loggableTypes.add(type);
  }
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:12,代码来源:UnitTestTreeLogger.java

示例3: log

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
/**
 * Log a pretty-printed message if the given log level is active.  The message
 * is only formatted if it will be logged.
 */
public static void log(TreeLogger logger, TreeLogger.Type type, String formatString,
    Object... args) {
  if (logger.isLoggable(type)) {
    logger.log(type, format(formatString, args));
  }
}
 
开发者ID:google-code-export,项目名称:google-gin,代码行数:11,代码来源:PrettyPrinter.java

示例4: getNeedsAttentionLevel

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public String getNeedsAttentionLevel() {
  TreeLogger.Type maxNeedsAttentionLevel = null;

  synchronized (privateInstanceLock) {
    List<IModelNode> allChildren = new ArrayList<IModelNode>();
    allChildren.addAll(browserTabs);
    if (server != null) {
      allChildren.add(server);
    }

    for (IModelNode child : allChildren) {
      TreeLogger.Type childAttentionLevel = null;

      if (child.getNeedsAttentionLevel() != null) {
        childAttentionLevel = LogEntry.toTreeLoggerType(child.getNeedsAttentionLevel());
      }

      if (childAttentionLevel == null) {
        continue;
      }

      if (maxNeedsAttentionLevel == null
          || maxNeedsAttentionLevel.isLowerPriorityThan(childAttentionLevel)) {
        maxNeedsAttentionLevel = childAttentionLevel;
      }
    }
  }

  if (maxNeedsAttentionLevel == null) {
    return null;
  }

  return maxNeedsAttentionLevel.getLabel();
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:35,代码来源:LaunchConfiguration.java

示例5: toTreeLoggerType

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
/**
 * Returns the {@link TreeLogger.Type} enum value corresponding to the
 * <code>treeLoggerTypeName</code> or null if there isn't one.
 */
public static TreeLogger.Type toTreeLoggerType(String treeLoggerTypeName) {
  assert (treeLoggerTypeName != null);
  try {
    return TreeLogger.Type.valueOf(treeLoggerTypeName);
  } catch (IllegalArgumentException e) {
    // Ignored
  }

  return null;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:15,代码来源:LogEntry.java

示例6: shouldPropageLogLevelToParent

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
private boolean shouldPropageLogLevelToParent(Data parentLogData,
    Data childLogData) {
  TreeLogger.Type parentLogLevel = toTreeLoggerType(parentLogData.logLevel);
  TreeLogger.Type childLogLevel = toTreeLoggerType(childLogData.logLevel);
  return parentLogLevel == null || childLogLevel == null
      || parentLogLevel.isLowerPriorityThan(childLogLevel);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:8,代码来源:LogEntry.java

示例7: UnitTestTreeLogger

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public UnitTestTreeLogger(List<LogEntry> expectedEntries,
                          EnumSet<TreeLogger.Type> loggableTypes) {
  this.expectedEntries.addAll(expectedEntries);
  this.loggableTypes = loggableTypes;

  // Sanity check that all expected entries are actually loggable.
  for (LogEntry entry : expectedEntries) {
    Type type = entry.getType();
    Assert.assertTrue("Cannot expect an entry of a non-loggable type!",
                      isLoggable(type));
    loggableTypes.add(type);
  }
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:14,代码来源:UnitTestTreeLogger.java

示例8: expect

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public void expect(TreeLogger.Type type,
                   String msg,
                   Class<? extends Throwable> caught) {
  expected.add(new LogEntry(type,
                            msg,
                            caught));
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:8,代码来源:UnitTestTreeLogger.java

示例9: LogEntry

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public LogEntry(TreeLogger.Type type,
                String msg,
                Class<? extends Throwable> caught) {
  assert (type != null);
  this.type = type;
  this.msg = msg;
  this.caught = caught;
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:9,代码来源:UnitTestTreeLogger.java

示例10: expect

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public void expect(TreeLogger.Type type, String msg, Class<? extends Throwable> caught) {
  expected.add(new LogEntry(type, msg, caught));
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:4,代码来源:UnitTestTreeLogger.java

示例11: setLoggableTypes

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
/**
 * Sets the loggable types based on an explicit set.
 */
public void setLoggableTypes(EnumSet<TreeLogger.Type> loggableTypes) {
  this.loggableTypes = loggableTypes;
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:7,代码来源:UnitTestTreeLogger.java

示例12: LogEntry

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
public LogEntry(TreeLogger.Type type, String msg, Class<? extends Throwable> caught) {
  assert (type != null);
  this.type = type;
  this.msg = msg;
  this.caught = caught;
}
 
开发者ID:jcricket,项目名称:gwt-syncproxy,代码行数:7,代码来源:UnitTestTreeLogger.java

示例13: branch

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
@Override
public TreeLogger branch(TreeLogger.Type type, String msg, Throwable caught,
    HelpInfo helpInfo) {
  return this;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:6,代码来源:GwtProblemsTreeLogger.java

示例14: isLoggable

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
@Override
public boolean isLoggable(TreeLogger.Type type) {
  return (!type.isLowerPriorityThan(TreeLogger.WARN));
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:5,代码来源:GwtProblemsTreeLogger.java

示例15: isNewAttnLevelMoreImportantThanOldAttnLevel

import com.google.gwt.core.ext.TreeLogger; //导入方法依赖的package包/类
/**
 * Determine whether or not the new attention level is more important than the
 * old attention level. The level typically corresponds to one of the
 * {@link com.google.gwt.core.ext.TreeLogger.Type} values.
 * 
 * The new level will be deemed to be more important if:
 * 
 * 1) <code>newAttentionLevel</code> is non-null and
 * <code>oldAttentionLevel</code> is null
 * 
 * 2) <code>newAttentionLevel</code> is non-null and
 * <code>oldAttentionLevel</code> is a lower priority than
 * <code>newAttentionLevel</code>.
 * 
 * 3) <code>newAttentionLevel</code> is null and the
 * <code>oldAttentionLevel</code> is non-null
 * 
 * @param oldAttentionLevel the old attention level
 * @param newAttentionLevel the new attention level
 * 
 * @return true if <code>newAttentionLevel</code> is more important than
 *         <code>oldAttentionLevel</code>, false otherwise
 */
public static boolean isNewAttnLevelMoreImportantThanOldAttnLevel(
    String oldAttentionLevel, String newAttentionLevel) {

  if (oldAttentionLevel == newAttentionLevel) {
    // The two attention levels are equal; the new attention level is
    // not more important than the old attention level
    return false;
  }

  // If the two attention levels are non-null, check to see if
  // they're identical, or if the new level is a lower priority
  // than the old level. In either case, the new level is not
  // more important than the old level.
  if (oldAttentionLevel != null && newAttentionLevel != null) {

    if (oldAttentionLevel.equals(newAttentionLevel)) {
      // The attention levels are identical
      return false;
    }

    TreeLogger.Type oldLevel = LogEntry.toTreeLoggerType(oldAttentionLevel);
    TreeLogger.Type newLevel = LogEntry.toTreeLoggerType(newAttentionLevel);

    if (oldLevel == null || newLevel == null) {
      // Can't decipher the TreeLogger levels for either the old or new
      // attention levels; assume that the new level is not more important
      // the old level
      return false;
    }

    if (newLevel.isLowerPriorityThan(oldLevel)) {
      // The new level is at a lower level than the current level
      return false;
    }
  }

  /*
   * If we've reached this point, it is either the case that newAttentionLevel
   * is higher priority than oldAttentionLevel, or only one of
   * newAttentionLevel or oldAttentionLevel is null. In any of these cases,
   * the new level is more important than the old level.
   */
  return true;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:68,代码来源:AttentionLevelUtils.java


注:本文中的com.google.gwt.core.ext.TreeLogger.Type方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。