Package studio.mevera.imperat
Interface ThrowablePrinter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface responsible for printing throwables that are
caught but not otherwise handled.
This allows platforms to customise how unhandled exceptions are presented, whether by logging frameworks, plain printing, or other mechanisms.
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ThrowablePrinterbox()Returns a printer that formats the throwable into a decorative box and logs it using theIMPERATlogger.voidPrints the stacktrace for the given throwable.static @NotNull ThrowablePrintersimple()Returns a simple printer that logs the throwable using theIMPERATlogger.
-
Method Details
-
simple
Returns a simple printer that logs the throwable using theIMPERATlogger.- Returns:
- a basic throwable printer
-
box
Returns a printer that formats the throwable into a decorative box and logs it using theIMPERATlogger.- Returns:
- a boxed throwable printer
-
print
Prints the stacktrace for the given throwable.- Parameters:
throwable- the throwable to print
-