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


Java PathManager.getLogPath方法代碼示例

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


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

示例1: notifyUser

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public static void notifyUser(String message) {
  final String logFile = PathManager.getLogPath();
  /*String createIssuePart = "<br>" +
                           "<br>" +
                           "Please attach log files from <a href=\"file\">" + logFile + "</a><br>" +
                           "to the <a href=\"url\">YouTrack issue</a>";*/
  Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID,
                                            "Local History is broken",
                                            message /*+ createIssuePart*/,
                                            NotificationType.ERROR,
                                            new NotificationListener() {
                                              @Override
                                              public void hyperlinkUpdate(@NotNull Notification notification,
                                                                          @NotNull HyperlinkEvent event) {
                                                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                                                  if ("url".equals(event.getDescription())) {
                                                    BrowserUtil.browse("http://youtrack.jetbrains.net/issue/IDEA-71270");
                                                  }
                                                  else {
                                                    File file = new File(logFile);
                                                    ShowFilePathAction.openFile(file);
                                                  }
                                                }
                                              }
                                            }), null);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:ChangeListStorageImpl.java

示例2: deleteOldThreadDumps

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static void deleteOldThreadDumps() {
  File allLogsDir = new File(PathManager.getLogPath());
  if (allLogsDir.isDirectory()) {
    final String[] dirs = allLogsDir.list(new FilenameFilter() {
      @Override
      public boolean accept(@NotNull final File dir, @NotNull final String name) {
        return name.startsWith("threadDumps-");
      }
    });
    if (dirs != null) {
      Arrays.sort(dirs);
      for (int i = 0; i < dirs.length - 11; i++) {
        FileUtil.delete(new File(allLogsDir, dirs [i]));
      }
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:PerformanceWatcher.java

示例3: init

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private void init() {
  try {
    System.setProperty("log4j.defaultInitOverride", "true");

    File logXmlFile = FileUtil.findFirstThatExist(PathManager.getHomePath() + "/bin/log.xml",
                                                  PathManager.getHomePath() + "/community/bin/log.xml");
    if (logXmlFile == null) {
      throw new RuntimeException("log.xml file does not exist! Path: [ $home/bin/log.xml]");
    }

    String text = FileUtil.loadFile(logXmlFile);
    text = StringUtil.replace(text, SYSTEM_MACRO, StringUtil.replace(PathManager.getSystemPath(), "\\", "\\\\"));
    text = StringUtil.replace(text, APPLICATION_MACRO, StringUtil.replace(PathManager.getHomePath(), "\\", "\\\\"));
    text = StringUtil.replace(text, LOG_DIR_MACRO, StringUtil.replace(PathManager.getLogPath(), "\\", "\\\\"));

    File file = new File(PathManager.getLogPath());
    if (!file.mkdirs() && !file.exists()) {
      System.err.println("Cannot create log directory: " + file);
    }

    new DOMConfigurator().doConfigure(new StringReader(text), LogManager.getLoggerRepository());

    myInitialized = true;
  }
  catch (Exception e) {
    e.printStackTrace();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:29,代碼來源:LoggerFactory.java

示例4: initLogOutput

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private void initLogOutput() {
  if (CvsApplicationLevelConfiguration.getInstance().DO_OUTPUT) {
    final File cvsOutputFile = new File(PathManager.getLogPath(), OUTPUT_FILE_NAME);
    if (cvsOutputFile.isFile() && cvsOutputFile.length() > MAX_OUTPUT_SIZE) {
      FileUtil.delete(cvsOutputFile);
    }
    myLogOutput = createFileOutputStream(cvsOutputFile);
  } else {
    myLogOutput = DUMMY_OUTPUT_STREAM;
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:StreamLogger.java

示例5: lookup

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Override
public String lookup(String key) {

    return PathManager.getLogPath();
}
 
開發者ID:vcu-swim-lab,項目名稱:stack-intheflow,代碼行數:6,代碼來源:LogPathLookup.java

示例6: logTest

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Test
public void logTest(){

    //Jasypt encryptor to generate encrypted information

    /*
    StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
    encryptor.setPassword("jasypt");
    String usr = encryptor.encrypt("INSERT");
    System.out.println(usr);
    String pw = encryptor.encrypt("INSERT");
    System.out.println(pw);
    String ip = encryptor.encrypt("INSERT");
    System.out.println(ip);
    */


    //Checks if file exists and has content

    System.out.println(PathManager.getLogPath());
    logger.info("\"" + "Test" + "\"" + ":" + "\"" + "Hello World!" + "\"" + "}");
    File file = new File(PathManager.getLogPath() + "/logfile.log");

    try{
    Scanner scanner = new Scanner(file);
    List<String> list=new ArrayList<>();
    while(scanner.hasNextLine()){
        list.add(scanner.nextLine());
    }

    if(list.isEmpty()){

        assertTrue(false);
    }else{
        assertTrue(true);
    }


}catch (Exception e){
        e.printStackTrace();
    }

}
 
開發者ID:vcu-swim-lab,項目名稱:stack-intheflow,代碼行數:44,代碼來源:LogTest.java

示例7: getBuildLogDirectory

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public File getBuildLogDirectory() {
  return new File(PathManager.getLogPath(), "build-log");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:BuildManager.java

示例8: getPtyLogFile

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static File getPtyLogFile() {
  return new File(PathManager.getLogPath(), "pty.log");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:PtyCommandLine.java

示例9: actionPerformed

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
  final File logFile = new File(PathManager.getLogPath(), "idea.log");
  ShowFilePathAction.openFile(logFile);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:ShowLogAction.java

示例10: execute

import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Override
protected void execute(@NotNull Project project) {
  File logFile = new File(PathManager.getLogPath(), IDEA_LOG_FILE_NAME);
  ShowFilePathAction.openFile(logFile);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:ShowLogHyperlink.java


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