本文整理匯總了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);
}
示例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]));
}
}
}
}
示例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();
}
}
示例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;
}
}
示例5: lookup
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
@Override
public String lookup(String key) {
return PathManager.getLogPath();
}
示例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();
}
}
示例7: getBuildLogDirectory
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
public File getBuildLogDirectory() {
return new File(PathManager.getLogPath(), "build-log");
}
示例8: getPtyLogFile
import com.intellij.openapi.application.PathManager; //導入方法依賴的package包/類
private static File getPtyLogFile() {
return new File(PathManager.getLogPath(), "pty.log");
}
示例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);
}
示例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);
}