mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Merge pull request #3083 from J3fftw1/feature/added-time_date-to-error-report
added time and date to error report
This commit is contained in:
commit
343f47bdb6
@ -34,10 +34,10 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage;
|
|||||||
* To ensure that the console doesn't get too spammy, we destroy the block and generate
|
* To ensure that the console doesn't get too spammy, we destroy the block and generate
|
||||||
* an {@link ErrorReport} instead.
|
* an {@link ErrorReport} instead.
|
||||||
* Error reports get saved in the plugin folder.
|
* Error reports get saved in the plugin folder.
|
||||||
*
|
*
|
||||||
* @param <T>
|
* @param <T>
|
||||||
* The type of {@link Throwable} which has spawned this {@link ErrorReport}
|
* The type of {@link Throwable} which has spawned this {@link ErrorReport}
|
||||||
*
|
*
|
||||||
* @author TheBusyBiscuit
|
* @author TheBusyBiscuit
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -54,7 +54,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
* This is the base constructor for an {@link ErrorReport}. It will only
|
* This is the base constructor for an {@link ErrorReport}. It will only
|
||||||
* print the necessary info and provides a {@link Consumer} for any more detailed
|
* print the necessary info and provides a {@link Consumer} for any more detailed
|
||||||
* needs.
|
* needs.
|
||||||
*
|
*
|
||||||
* @param throwable
|
* @param throwable
|
||||||
* The {@link Throwable} which caused this {@link ErrorReport}.
|
* The {@link Throwable} which caused this {@link ErrorReport}.
|
||||||
* @param addon
|
* @param addon
|
||||||
@ -73,7 +73,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
/**
|
/**
|
||||||
* This constructs a new {@link ErrorReport} for the given {@link Location} and
|
* This constructs a new {@link ErrorReport} for the given {@link Location} and
|
||||||
* {@link SlimefunItem}.
|
* {@link SlimefunItem}.
|
||||||
*
|
*
|
||||||
* @param throwable
|
* @param throwable
|
||||||
* The {@link Throwable} which caused this {@link ErrorReport}.
|
* The {@link Throwable} which caused this {@link ErrorReport}.
|
||||||
* @param l
|
* @param l
|
||||||
@ -116,7 +116,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructs a new {@link ErrorReport} for the given {@link SlimefunItem}.
|
* This constructs a new {@link ErrorReport} for the given {@link SlimefunItem}.
|
||||||
*
|
*
|
||||||
* @param throwable
|
* @param throwable
|
||||||
* The {@link Throwable} which caused this {@link ErrorReport}.
|
* The {@link Throwable} which caused this {@link ErrorReport}.
|
||||||
* @param item
|
* @param item
|
||||||
@ -134,7 +134,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the {@link File} this {@link ErrorReport} has been written to.
|
* This method returns the {@link File} this {@link ErrorReport} has been written to.
|
||||||
*
|
*
|
||||||
* @return The {@link File} for this {@link ErrorReport}
|
* @return The {@link File} for this {@link ErrorReport}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@ -144,7 +144,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns the {@link Throwable} that was thrown.
|
* This returns the {@link Throwable} that was thrown.
|
||||||
*
|
*
|
||||||
* @return The {@link Throwable}
|
* @return The {@link Throwable}
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@ -154,7 +154,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns the amount of {@link ErrorReport ErrorReports} created in this session.
|
* This method returns the amount of {@link ErrorReport ErrorReports} created in this session.
|
||||||
*
|
*
|
||||||
* @return The amount of {@link ErrorReport ErrorReports} created.
|
* @return The amount of {@link ErrorReport ErrorReports} created.
|
||||||
*/
|
*/
|
||||||
public static int count() {
|
public static int count() {
|
||||||
@ -168,6 +168,9 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
try (PrintStream stream = new PrintStream(file, StandardCharsets.UTF_8.name())) {
|
try (PrintStream stream = new PrintStream(file, StandardCharsets.UTF_8.name())) {
|
||||||
stream.println();
|
stream.println();
|
||||||
|
|
||||||
|
stream.println("Error Generated: " + dateFormat.format(LocalDateTime.now()));
|
||||||
|
stream.println();
|
||||||
|
|
||||||
stream.println("Java Environment:");
|
stream.println("Java Environment:");
|
||||||
stream.println(" Operating System: " + System.getProperty("os.name"));
|
stream.println(" Operating System: " + System.getProperty("os.name"));
|
||||||
stream.println(" Java Version: " + System.getProperty("java.version"));
|
stream.println(" Java Version: " + System.getProperty("java.version"));
|
||||||
@ -259,7 +262,7 @@ public class ErrorReport<T extends Throwable> {
|
|||||||
* This helper method wraps the given {@link Runnable} into a try-catch block.
|
* This helper method wraps the given {@link Runnable} into a try-catch block.
|
||||||
* When an {@link Exception} occurs, a new {@link ErrorReport} will be generated using
|
* When an {@link Exception} occurs, a new {@link ErrorReport} will be generated using
|
||||||
* the provided {@link Function}.
|
* the provided {@link Function}.
|
||||||
*
|
*
|
||||||
* @param function
|
* @param function
|
||||||
* The {@link Function} to generate a new {@link ErrorReport}
|
* The {@link Function} to generate a new {@link ErrorReport}
|
||||||
* @param runnable
|
* @param runnable
|
||||||
|
Loading…
Reference in New Issue
Block a user