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


Java Logger.isDebugEnabled方法代碼示例

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


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

示例1: prettyFormatResponseToLog

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
public static void prettyFormatResponseToLog(@NotNull Logger logger, @NotNull HttpResponse response) {
  if (logger.isDebugEnabled()) {
    try {
      String content = TaskResponseUtil.getResponseContentAsString(response);
      org.apache.http.Header header = response.getEntity().getContentType();
      String contentType = header == null ? "text/plain" : header.getElements()[0].getName().toLowerCase(Locale.ENGLISH);
      if (contentType.contains("xml")) {
        prettyFormatXmlToLog(logger, content);
      }
      else if (contentType.contains("json")) {
        prettyFormatJsonToLog(logger, content);
      }
      else {
        logger.debug(content);
      }
    }
    catch (IOException e) {
      logger.error(e);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:TaskUtil.java

示例2: getPlatformNotifier

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
private static Notifier getPlatformNotifier() {
  try {
    if (SystemInfo.isMac) {
      if (SystemInfo.isMacOSMountainLion && Registry.is("ide.mac.mountain.lion.notifications.enabled")) {
        return MountainLionNotifications.getInstance();
      }
      if (!Boolean.getBoolean("growl.disable")) {
        return GrowlNotifications.getInstance();
      }
    }

    if (SystemInfo.isXWindow && Registry.is("ide.libnotify.enabled") ) {
      return LibNotifyWrapper.getInstance();
    }
  }
  catch (Throwable t) {
    Logger logger = Logger.getInstance(SystemNotifications.class);
    if (logger.isDebugEnabled()) {
      logger.debug(t);
    }
    else {
      logger.info(t.getMessage());
    }
  }

  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:28,代碼來源:SystemNotificationsImpl.java

示例3: prettyFormatXmlToLog

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
/**
 * Print pretty-formatted XML to {@code logger}, if its level is DEBUG or below.
 */
public static void prettyFormatXmlToLog(@NotNull Logger logger, @NotNull Element element) {
  if (logger.isDebugEnabled()) {
    // alternatively
    //new XMLOutputter(Format.getPrettyFormat()).outputString(root)
    logger.debug("\n" + JDOMUtil.createOutputter("\n").outputString(element));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:TaskUtil.java

示例4: prettyFormatJsonToLog

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
/**
 * Parse and print pretty-formatted Json to {@code logger}, if its level is DEBUG or below.
 */
public static void prettyFormatJsonToLog(@NotNull Logger logger, @NotNull String json) {
  if (logger.isDebugEnabled()) {
    try {
      Gson gson = new GsonBuilder().setPrettyPrinting().create();
      logger.debug("\n" + gson.toJson(gson.fromJson(json, JsonElement.class)));
    }
    catch (JsonSyntaxException e) {
      logger.debug("Malformed JSON\n" + json);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:TaskUtil.java

示例5: log

import com.intellij.openapi.diagnostic.Logger; //導入方法依賴的package包/類
private static void log(String format, Object... args) {
  Logger logger = Logger.getInstance(SocketLock.class);
  if (logger.isDebugEnabled()) {
    logger.debug(String.format(format, args));
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:SocketLock.java


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