Interface MixinLoggingFacade
-
- All Known Implementing Classes:
DefaultMixinLogger
public interface MixinLoggingFacadeThere comes a time where any library must log something. Be it for debug purposes, error handling or simple warnings for things that were dealt with in a sub-standard fashion.Ordinarily we'd use SLF4J and call it a day, however in our case that'd be a bit difficult given that micromixin-transformer supports runtimes as low as Java 6. SLF4J 1.7.X would suffice as it supports Java 5+ - but from the other side it'd be difficult for the Java 9+ users who use JPMS, where usage of SLF4J 2.0.X might be
In order to appeal to everyone the simple decision of simply allowing the API consumer to choose what they want was made. By default logging will happen entirely via
System.outorSystem.err. In the default implementation, debug logging only occurs if the debug flag is set - otherwise the debug statements are not logged. However, other implementations may ignore the debug system propertyorg.stianloader.micromixin.debug.This facade should support "standard" SLF4J placeholders via "{}". Not all arguments may map to a placeholder. They should simply be appended to the end of the message. Leftover "{}" placeholders need to be kept as-is. Implementations of this interface are free to assume that "{}" never need to be escaped and that likewise no indexing occurs (that "{2}" should never happen). If the last argument is a
Throwable, it's stacktrace should be logged.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddebug(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)voiderror(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)voidinfo(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)voidwarn(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)
-
-
-
Method Detail
-
debug
void debug(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)
-
error
void error(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)
-
info
void info(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)
-
warn
void warn(java.lang.Class<?> clazz, java.lang.String message, java.lang.Object... args)
-
-