新增日志输出类

修复直播检测不绿的情况
This commit is contained in:
2021-04-01 21:11:15 +08:00
parent 51a0a3d111
commit 44272a609f
22 changed files with 102 additions and 160 deletions

View File

@@ -47,9 +47,9 @@ public class MavenWrapperDownloader {
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
com.yutou.bilibili.Tools.Log.i("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
com.yutou.bilibili.Tools.Log.i("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
@@ -63,7 +63,7 @@ public class MavenWrapperDownloader {
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
com.yutou.bilibili.Tools.Log.i("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if (mavenWrapperPropertyFileInputStream != null) {
@@ -74,22 +74,22 @@ public class MavenWrapperDownloader {
}
}
}
System.out.println("- Downloading from: " + url);
com.yutou.bilibili.Tools.Log.i("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if (!outputFile.getParentFile().exists()) {
if (!outputFile.getParentFile().mkdirs()) {
System.out.println(
com.yutou.bilibili.Tools.Log.i(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
com.yutou.bilibili.Tools.Log.i("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
com.yutou.bilibili.Tools.Log.i("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
com.yutou.bilibili.Tools.Log.i("- Error downloading");
e.printStackTrace();
System.exit(1);
}