support idea.log.path property in tests logger

This commit is contained in:
Leonid Shalupov
2017-01-13 16:04:34 +01:00
parent 93dc16aa6a
commit 9873a11c99
@@ -32,6 +32,8 @@ import java.io.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.intellij.openapi.application.PathManager.PROPERTY_LOG_PATH;
@SuppressWarnings({"CallToPrintStackTrace", "UseOfSystemOutOrSystemErr"})
public class TestLoggerFactory implements Logger.Factory {
private static final String SYSTEM_MACRO = "$SYSTEM_DIR$";
@@ -100,6 +102,8 @@ public class TestLoggerFactory implements Logger.Factory {
}
public static String getTestLogDir() {
if (System.getProperty(PROPERTY_LOG_PATH) != null) return System.getProperty(PROPERTY_LOG_PATH);
return PathManager.getSystemPath() + "/" + LOG_DIR;
}