當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。