mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[yole] Log IDE name/ version/build date, JRE and JVM version/vendor
This commit is contained in:
@@ -15,11 +15,15 @@
|
||||
*/
|
||||
package com.intellij.idea;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationInfo;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.application.ConfigImportHelper;
|
||||
import com.intellij.openapi.application.PathManager;
|
||||
import com.intellij.openapi.application.impl.ApplicationInfoImpl;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.ui.AppUIUtil;
|
||||
import com.intellij.util.text.DateFormatUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -63,10 +67,17 @@ public class MainImpl {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread("Shutdown hook - logging") {
|
||||
public void run() {
|
||||
LOG.info(
|
||||
"------------------------------------------------------ IDEA SHUTDOWN ------------------------------------------------------");
|
||||
"------------------------------------------------------ IDE SHUTDOWN ------------------------------------------------------");
|
||||
}
|
||||
});
|
||||
LOG.info("------------------------------------------------------ IDEA STARTED ------------------------------------------------------");
|
||||
LOG.info("------------------------------------------------------ IDE STARTED ------------------------------------------------------");
|
||||
|
||||
final ApplicationInfo appInfo = ApplicationInfoImpl.getShadowInstance();
|
||||
final ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
|
||||
LOG.info("IDE: " + namesInfo.getFullProductName() + " (build #" + appInfo.getBuild() + ", " +
|
||||
DateFormatUtil.formatBuildDate(appInfo.getBuildDate()) + ")");
|
||||
LOG.info("JRE: " + System.getProperty("java.runtime.version", "-") + " (" + System.getProperty("java.vendor", "-") + ")");
|
||||
LOG.info("JVM: " + System.getProperty("java.vm.version", "-") + " (" + System.getProperty("java.vm.vendor", "-") + ")");
|
||||
|
||||
_main(args);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,7 @@ import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
public class DateFormatUtil {
|
||||
private static final Logger LOG = Logger.getInstance("com.intellij.util.text.DateFormatUtil");
|
||||
@@ -38,6 +39,9 @@ public class DateFormatUtil {
|
||||
private static final SyncDateFormat TIME_WITH_SECONDS_FORMAT = getFormat(DateFormat.MEDIUM, DateType.TIME);
|
||||
private static final SyncDateFormat DATE_TIME_FORMAT = getFormat(DateFormat.SHORT, DateType.DATETIME);
|
||||
|
||||
// fixed formats - should be locale-independent
|
||||
private static final SimpleDateFormat BUILD_DATE_FORMAT = new SimpleDateFormat("dd MMM yyyy HH:ss", Locale.US);
|
||||
|
||||
public static final long SECOND = 1000;
|
||||
public static final long MINUTE = SECOND * 60;
|
||||
public static final long HOUR = MINUTE * 60;
|
||||
@@ -464,4 +468,9 @@ public class DateFormatUtil {
|
||||
private static final int MacFormatterLongStyle = 3;
|
||||
private static final int MacFormatterFullStyle = 4;
|
||||
private static final int MacFormatterBehavior_10_4 = 1040;
|
||||
|
||||
@NotNull
|
||||
public static String formatBuildDate(@NotNull Calendar cal) {
|
||||
return BUILD_DATE_FORMAT.format(cal.getTime());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user