Skip to content

Commit

Permalink
chore: More debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
VidTu committed Jun 12, 2024
1 parent 52fcf8a commit c8365c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion .idea/inspectionProfiles/VidTu_Ksyxis.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions src/main/java/ru/vidtu/ksyxis/KsyxisPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,16 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
try {
// Only apply if node exists.
ClassNode node = MixinService.getService().getBytecodeProvider().getClassNode(targetClassName);
return node != null;
if (node != null) {
// Found - apply.
LOGGER.debug("Ksyxis: Applying {} to {}, class node does exist.", new Object[]{mixinClassName, targetClassName}); // <- Array for compat with log4j 2.0-beta.9.
return true;
}
LOGGER.debug("Ksyxis: Not applying {} to {}, class node is null.", new Object[]{mixinClassName, targetClassName}); // <- Array for compat with log4j 2.0-beta.9.
return false;
} catch (ClassNotFoundException e) {
// Not found - don't apply.
LOGGER.debug("Ksyxis: Not applying {} to {}, class not found.", new Object[]{mixinClassName, targetClassName, e}); // <- Array for compat with log4j 2.0-beta.9.
LOGGER.debug("Ksyxis: Not applying {} to {}, class node was not found.", new Object[]{mixinClassName, targetClassName, e}); // <- Array for compat with log4j 2.0-beta.9.
return false;
} catch (Throwable t) {
// Try my lucky day, apply anyway.
Expand Down

0 comments on commit c8365c7

Please sign in to comment.