Better logging?

This commit is contained in:
drmDev 2016-04-14 12:46:42 -04:00
parent ad0dde4501
commit aa033617a2
2 changed files with 10 additions and 2 deletions

View file

@ -110,7 +110,8 @@ public class AbilitiesImpl<T extends Ability> extends ArrayList<T> implements Ab
rules.add(Character.toUpperCase(rule.charAt(0)) + rule.substring(1));
}
} else { // logging so we can still can be made aware of rule problems a card has
logger.fatal("Error in rule text generation of " + source + ": Create a bug report or fix the source code");
String cardName = ((SpellAbility) ability).getCardName();
logger.fatal("Error in rule text generation of " + cardName + ": Create a bug report or fix the source code");
}
}
}

View file

@ -29,6 +29,7 @@ package mage.abilities.keyword;
import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -142,7 +143,13 @@ public class AwakenAbility extends SpellAbility {
if (source == null) {
logger.fatal("Source was null in AwakenAbility: Create a bug report or fix the source code");
} else if (source.getTargets() == null) {
logger.fatal("getTargets was null in AwakenAbility for " + source + " : Create a bug report or fix the source code");
MageObject sourceObj = source.getSourceObject(game);
if (sourceObj != null) {
Class<? extends MageObject> sourceClass = sourceObj.getClass();
if (sourceClass != null) {
logger.fatal("getTargets was null in AwakenAbility for " + sourceClass.toString() + " : Create a bug report or fix the source code");
}
}
}
}
return true;