类 DebugService
java.lang.Object
pkg.exoad.poprock.core.debug.DebugService
Debug Service - Utility class for handling various exceptions that can be thrown during
the runtime of this program.
Most of the things occuring here like throwing errors should only happen in development. This is especially the case because the hints provided are only able to.
Most of the things occuring here like throwing errors should only happen in development. This is especially the case because the hints provided are only able to.
- 作者:
- Jack Meng
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static StringIf you wish to edit this.static StringIf you wish to edit this, it must follow the format accepted bySimpleDateFormatprivate static PrintStreamprivate static booleanprivate static boolean -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidallowCustomStackTrace(boolean b) Sets whether any panic messages or other messages for exceptions and errors are thrown to the print stream with a customized stack trace.static voidallowPanicking(boolean b) Sets whether any functions depending on any of the DebugService'spanicfunctions will not be able to emit anything.static booleancanPanic()Whether the debug service is allowed to panic the current program.static PrintStreamgetOut()static voidMacro call forDebugService.log(LogLevel.INFO,...)static booleanWhether the debug service is using custom stack traces for panickingstatic voidlog(DebugService.LogLevel level, Object msg) Logs a message to the console with the specified levelstatic RuntimeExceptionmodifyThrowable(Throwable throwable) static voidMacro call forDebugService.log(LogLevel.NOTE,...)static voidTells the debug service to prepare an exception right now because of an internal error.static voidTells the debug service to prepare an exception ONLY IF the condition passed returns TRUEstatic voidSimilar topanicOn(boolean,String)but instead you can also pass a related cause of this exception.static voidstatic voidInstructs the service to kill the current program with a runtime exception and another exception or throwable provided.static voidSets the internal output stream used by this debug servicestatic voidMacro call forDebugService.log(LogLevel.WARN,...)
-
字段详细资料
-
logMessageFormat
If you wish to edit this. The format defines the following tags:{0}denotes theDebugService.LogLevel{1}denotes the time invoked inmm/dd/yy HH:MM:SSformat{2}denotes the part where the message of the log entry will be shown
-
logTimeStampFormat
If you wish to edit this, it must follow the format accepted bySimpleDateFormat -
out
-
USE_PANIC
private static boolean USE_PANIC -
USE_CUSTOM_STACK_TRACE
private static boolean USE_CUSTOM_STACK_TRACE
-
-
构造器详细资料
-
DebugService
private DebugService()
-
-
方法详细资料
-
allowCustomStackTrace
public static void allowCustomStackTrace(boolean b) Sets whether any panic messages or other messages for exceptions and errors are thrown to the print stream with a customized stack trace.This option only exists to reduce cluster in pre existing exceptions
- 参数:
b- on or off
-
isUsingCustomStackTraces
public static boolean isUsingCustomStackTraces()Whether the debug service is using custom stack traces for panicking- 返回:
- true or false
-
allowPanicking
public static void allowPanicking(boolean b) Sets whether any functions depending on any of the DebugService'spanicfunctions will not be able to emit anything.THIS IS A VERY DANGEROUS METHOD, JUST LEAVE IT ON!!
- 参数:
b- on or off
-
canPanic
public static boolean canPanic()Whether the debug service is allowed to panic the current program. Most of the time this is set totrueunlessallowPanicking(boolean)is modified.- 返回:
- true or false
-
info
Macro call forDebugService.log(LogLevel.INFO,...)- 参数:
msg- message
-
log
Logs a message to the console with the specified level- 参数:
level- The level of the logmsg- The message to log
-
getOut
- 返回:
- The internal output stream used by this debug service
-
setOut
Sets the internal output stream used by this debug service- 参数:
p- The new output stream
-
warn
Macro call forDebugService.log(LogLevel.WARN,...)- 参数:
msg- message
-
note
Macro call forDebugService.log(LogLevel.NOTE,...)- 参数:
msg- message
-
panicNow
Tells the debug service to prepare an exception right now because of an internal error. Also note this is a synchronized method meaning only ONE thread may call it at a time.- 参数:
message- The error message. THIS SHOULD NOT BE AUTOMATICALLY GENERATED
-
panicOn
Tells the debug service to prepare an exception ONLY IF the condition passed returns TRUE- 参数:
condition- The conditionmessage- The message. THIS SHOULD NOT BE AUTOMATICALLY GENERATED. [This is usually the hint given to a programmer]
-
modifyThrowable
-
panicWith
Instructs the service to kill the current program with a runtime exception and another exception or throwable provided.- 参数:
e- The other provided throwable
-
panicWith
-
panicOn
Similar topanicOn(boolean,String)but instead you can also pass a related cause of this exception.- 参数:
condition- The conditionmessage- The messagecause- The related caused exception- 另请参阅:
-