當前位置: 首頁>>代碼示例>>Java>>正文


Java LogRecord.getCategory方法代碼示例

本文整理匯總了Java中org.apache.log4j.lf5.LogRecord.getCategory方法的典型用法代碼示例。如果您正苦於以下問題:Java LogRecord.getCategory方法的具體用法?Java LogRecord.getCategory怎麽用?Java LogRecord.getCategory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.log4j.lf5.LogRecord的用法示例。


在下文中一共展示了LogRecord.getCategory方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addLogRecord

import org.apache.log4j.lf5.LogRecord; //導入方法依賴的package包/類
public void addLogRecord(LogRecord lr) {
  CategoryPath path = new CategoryPath(lr.getCategory());
  addCategory(path); // create category path if it is new
  CategoryNode node = getCategoryNode(path);
  node.addRecord(); // update category node
  if (_renderFatal && lr.isFatal()) {
    TreeNode[] nodes = getPathToRoot(node);
    int len = nodes.length;
    CategoryNode parent;

    // i = 0 gives root node
    // skip node and root, loop through "parents" in between
    for (int i = 1; i < len - 1; i++) {
      parent = (CategoryNode) nodes[i];
      parent.setHasFatalChildren(true);
      nodeChanged(parent);
    }
    node.setHasFatalRecords(true);
    nodeChanged(node);
  }
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:22,代碼來源:CategoryExplorerModel.java

示例2: createNDCLogRecordFilter

import org.apache.log4j.lf5.LogRecord; //導入方法依賴的package包/類
protected LogRecordFilter createNDCLogRecordFilter(String text) {
  _NDCTextFilter = text;
  LogRecordFilter result = new LogRecordFilter() {
    public boolean passes(LogRecord record) {
      String NDC = record.getNDC();
      CategoryPath path = new CategoryPath(record.getCategory());
      if (NDC == null || _NDCTextFilter == null) {
        return false;
      } else if (NDC.toLowerCase().indexOf(_NDCTextFilter.toLowerCase()) == -1) {
        return false;
      } else {
        return getMenuItem(record.getLevel()).isSelected() &&
            _categoryExplorerTree.getExplorerModel().isCategoryPathActive(path);
      }
    }
  };

  return result;
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:20,代碼來源:LogBrokerMonitor.java

示例3: getColumn

import org.apache.log4j.lf5.LogRecord; //導入方法依賴的package包/類
protected Object getColumn(int col, LogRecord lr) {
  if (lr == null) {
    return "NULL Column";
  }
  String date = new Date(lr.getMillis()).toString();
  switch (col) {
    case 0:
      return date + " (" + lr.getMillis() + ")";
    case 1:
      return lr.getThreadDescription();
    case 2:
      return new Long(lr.getSequenceNumber());
    case 3:
      return lr.getLevel();
    case 4:
      return lr.getNDC();
    case 5:
      return lr.getCategory();
    case 6:
      return lr.getMessage();
    case 7:
      return lr.getLocation();
    case 8:
      return lr.getThrownStackTrace();
    default:
      String message = "The column number " + col + "must be between 0 and 8";
      throw new IllegalArgumentException(message);
  }
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:30,代碼來源:FilteredLogTableModel.java

示例4: createLogRecordFilter

import org.apache.log4j.lf5.LogRecord; //導入方法依賴的package包/類
protected LogRecordFilter createLogRecordFilter() {
  LogRecordFilter result = new LogRecordFilter() {
    public boolean passes(LogRecord record) {
      CategoryPath path = new CategoryPath(record.getCategory());
      return
          getMenuItem(record.getLevel()).isSelected() &&
          _categoryExplorerTree.getExplorerModel().isCategoryPathActive(path);
    }
  };
  return result;
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:12,代碼來源:LogBrokerMonitor.java

示例5: passes

import org.apache.log4j.lf5.LogRecord; //導入方法依賴的package包/類
/**
 * @return true if the CategoryExplorer model specified at construction
 * is accepting the category of the specified LogRecord.  Has a side-effect
 * of adding the CategoryPath of the LogRecord to the explorer model
 * if the CategoryPath is new.
 */
public boolean passes(LogRecord record) {
  CategoryPath path = new CategoryPath(record.getCategory());
  return _model.isCategoryPathActive(path);
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:11,代碼來源:CategoryExplorerLogRecordFilter.java


注:本文中的org.apache.log4j.lf5.LogRecord.getCategory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。