当前位置: 首页>>代码示例>>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;未经允许,请勿转载。