PY-18039 Throughout debug logging for PyPackageManager and helper methods
authorMikhail Golubev <mikhail.golubev@jetbrains.com>
Mon, 6 Jun 2016 19:08:36 +0000 (22:08 +0300)
committerMikhail Golubev <mikhail.golubev@jetbrains.com>
Thu, 23 Jun 2016 14:40:55 +0000 (17:40 +0300)
When we either launch packaging_tool.py or attempt to show modal dialog
the stacktrace of the call site is added to debug messages.

python/src/com/jetbrains/python/PyBundle.properties
python/src/com/jetbrains/python/packaging/PyPackageManagerImpl.java
python/src/com/jetbrains/python/packaging/PyPackageUtil.java

index 62055e41c78ffe3df20fbda56db9bfa61e311fab..d1e327049b9aef645ef74f74d138bdddd49a36a4 100644 (file)
@@ -890,6 +890,7 @@ sdk.gen.reading.versions.file=Reading versions file...
 sdk.gen.notify.converting.old.skels=Converting old skeletons
 sdk.gen.notify.converting.text=Skeletons of binary modules seem to be from an older version.<br/>These will be fully re-generated, which will take some time, but will happen <i>only once</i>.<br/>Next time you open the project, only skeletons of new or updated binary modules will be re-generated.
 sdk.gen.updating.interpreter=Updating Python Interpreter
+sdk.scanning.installed.packages=Scanning Installed Packages
 sdk.gen.stubs.for.binary.modules=Generate stubs for binary module {0}
 
 # Active SDK configurable and related dialogs
index 941dd15e7b7876c63c9cdaa92a701ba26b80f48f..a82dfb40e0c9a5fa03f6c809f8c46004b268e3e2 100644 (file)
@@ -260,6 +260,7 @@ public class PyPackageManagerImpl extends PyPackageManager {
   protected List<PyPackage> collectPackages() throws ExecutionException {
     final String output;
     try {
+      LOG.debug("Collecting installed packages for the SDK " + mySdk.getName(), new Throwable());
       output = getHelperResult(PACKAGING_TOOL, Collections.singletonList("list"), false, false, null);
     }
     catch (final ProcessNotCreatedException ex) {
index fb88e90cd2caf88e1379e856dc275daf10091a11..214b5694719bfa6d34614f1a8c48fe01db7af3c8 100644 (file)
@@ -34,6 +34,7 @@ import com.intellij.openapi.vfs.VirtualFileVisitor;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.PsiManager;
+import com.jetbrains.python.PyBundle;
 import com.jetbrains.python.PyNames;
 import com.jetbrains.python.codeInsight.controlflow.ScopeOwner;
 import com.jetbrains.python.packaging.setupPy.SetupTaskIntrospector;
@@ -279,7 +280,8 @@ public class PyPackageUtil {
   @Nullable
   public static List<PyPackage> refreshAndGetPackagesModally(@NotNull Sdk sdk) {
     final Ref<List<PyPackage>> packagesRef = Ref.create();
-    PyUtil.runWithProgress(null, "Scanning Installed Packages", true, false, indicator -> {
+    LOG.debug("Showing modal progress for collecting installed packages", new Throwable());
+    PyUtil.runWithProgress(null, PyBundle.message("sdk.scanning.installed.packages"), true, false, indicator -> {
       indicator.setIndeterminate(true);
       try {
         packagesRef.set(PyPackageManager.getInstance(sdk).refreshAndGetPackages(false));