PY-18039 Throughout debug logging for PyPackageManager and helper methods

When we either launch packaging_tool.py or attempt to show modal dialog
the stacktrace of the call site is added to debug messages.
This commit is contained in:
Mikhail Golubev
2016-06-23 17:40:55 +03:00
parent d7fe9d7095
commit 0a037df9be
3 changed files with 5 additions and 1 deletions
@@ -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
@@ -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) {
@@ -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));