Include date and build date in logs
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import java.text.SimpleDateFormat
|
||||||
|
|
||||||
buildscript{
|
buildscript{
|
||||||
ext{
|
ext{
|
||||||
arcHash = property("archash")
|
arcHash = property("archash")
|
||||||
@@ -137,6 +139,7 @@ allprojects{
|
|||||||
props["number"] = versionNumber
|
props["number"] = versionNumber
|
||||||
props["modifier"] = versionModifier
|
props["modifier"] = versionModifier
|
||||||
props["build"] = buildid
|
props["build"] = buildid
|
||||||
|
props["buildDate"] = new SimpleDateFormat("MMMM d, yyyy HH:mm a", Locale.getDefault()).format(new Date())
|
||||||
props["commitHash"] = "unknown"
|
props["commitHash"] = "unknown"
|
||||||
if(project.hasProperty("showCommitHash")){
|
if(project.hasProperty("showCommitHash")){
|
||||||
props["commitHash"] = getCommitHash()
|
props["commitHash"] = getCommitHash()
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public class Version{
|
|||||||
public static String modifier = "unknown";
|
public static String modifier = "unknown";
|
||||||
/** Git commit hash (short) */
|
/** Git commit hash (short) */
|
||||||
public static String commitHash = "unknown";
|
public static String commitHash = "unknown";
|
||||||
|
/** Date that this version was built. */
|
||||||
|
public static String buildDate = "unknown";
|
||||||
/** Number specifying the major version, e.g. '4' */
|
/** Number specifying the major version, e.g. '4' */
|
||||||
public static int number;
|
public static int number;
|
||||||
/** Build number, e.g. '43'. set to '-1' for custom builds. */
|
/** Build number, e.g. '43'. set to '-1' for custom builds. */
|
||||||
@@ -34,7 +36,8 @@ public class Version{
|
|||||||
type = map.get("type");
|
type = map.get("type");
|
||||||
number = Integer.parseInt(map.get("number", "4"));
|
number = Integer.parseInt(map.get("number", "4"));
|
||||||
modifier = map.get("modifier");
|
modifier = map.get("modifier");
|
||||||
commitHash = map.get("commitHash");
|
commitHash = map.get("commitHash", "unknown");
|
||||||
|
buildDate = map.get("buildDate", "unknown");
|
||||||
if(map.get("build").contains(".")){
|
if(map.get("build").contains(".")){
|
||||||
String[] split = map.get("build").split("\\.");
|
String[] split = map.get("build").split("\\.");
|
||||||
try{
|
try{
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ public class CrashHandler{
|
|||||||
}
|
}
|
||||||
|
|
||||||
return report
|
return report
|
||||||
+ "Version: " + Version.combined() + (Vars.headless ? " (Server)" : "") + "\n"
|
+ "Version: " + Version.combined() + (Version.buildDate.equals("unknown") ? "" : " (Built " + Version.buildDate + ")") + (Vars.headless ? " (Server)" : "") + "\n"
|
||||||
|
+ "Date: " + new SimpleDateFormat("MMMM d, yyyy HH:mm:ss a", Locale.getDefault()).format(new Date()) + "\n"
|
||||||
+ "OS: " + OS.osName + " x" + (OS.osArchBits) + " (" + OS.osArch + ")\n"
|
+ "OS: " + OS.osName + " x" + (OS.osArchBits) + " (" + OS.osArch + ")\n"
|
||||||
+ ((OS.isAndroid || OS.isIos) && app != null ? "Android API level: " + Core.app.getVersion() + "\n" : "")
|
+ ((OS.isAndroid || OS.isIos) && app != null ? "Android API level: " + Core.app.getVersion() + "\n" : "")
|
||||||
+ "Java Version: " + OS.javaVersion + "\n"
|
+ "Java Version: " + OS.javaVersion + "\n"
|
||||||
@@ -64,7 +65,7 @@ public class CrashHandler{
|
|||||||
|
|
||||||
//don't create crash logs for custom builds, as it's expected
|
//don't create crash logs for custom builds, as it's expected
|
||||||
if(OS.username.equals("anuke") && !"steam".equals(Version.modifier)){
|
if(OS.username.equals("anuke") && !"steam".equals(Version.modifier)){
|
||||||
System.exit(1);
|
// System.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//attempt to load version regardless
|
//attempt to load version regardless
|
||||||
|
|||||||
Reference in New Issue
Block a user