From 63c9107e14569834056326da22bb4a94bee134dd Mon Sep 17 00:00:00 2001 From: bdew Date: Wed, 18 Feb 2015 09:52:21 +0200 Subject: [PATCH] Lowered log level of some spammy messages in config system to Debug (closes #81) --- build.gradle | 2 +- src/net/bdew/gendustry/Gendustry.scala | 1 + src/net/bdew/gendustry/config/Fluids.scala | 4 ++-- .../bdew/gendustry/config/loader/Loader.scala | 24 +++++++++---------- .../bdew/gendustry/custom/BeeSpecies.scala | 8 +++---- .../bdew/gendustry/custom/CustomContent.scala | 12 +++++----- .../bdew/gendustry/misc/GeneticsCache.scala | 13 +++++----- 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index c5cf85d..c695e1e 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ apply plugin: 'scala' apply plugin: 'forge' version = "1.4.6" -ext.bdlibver = "1.6.2.41" +ext.bdlibver = "1.6.3.42" ext.versuffix = "mc1710" ext.apiVer = version diff --git a/src/net/bdew/gendustry/Gendustry.scala b/src/net/bdew/gendustry/Gendustry.scala index 97893d4..8c7373b 100644 --- a/src/net/bdew/gendustry/Gendustry.scala +++ b/src/net/bdew/gendustry/Gendustry.scala @@ -43,6 +43,7 @@ object Gendustry { var configDir: File = null + def logDebug(msg: String, args: Any*) = log.debug(msg.format(args: _*)) def logInfo(msg: String, args: Any*) = log.info(msg.format(args: _*)) def logWarn(msg: String, args: Any*) = log.warn(msg.format(args: _*)) def logError(msg: String, args: Any*) = log.error(msg.format(args: _*)) diff --git a/src/net/bdew/gendustry/config/Fluids.scala b/src/net/bdew/gendustry/config/Fluids.scala index 799c06f..f9ee85c 100644 --- a/src/net/bdew/gendustry/config/Fluids.scala +++ b/src/net/bdew/gendustry/config/Fluids.scala @@ -31,10 +31,10 @@ object Fluids extends FluidManager { isGaseous: Boolean = false): Fluid = { val ownFluid = if (FluidRegistry.isFluidRegistered(id)) { - Gendustry.logInfo("Fluid %s already registered, using existing (%s)", id, FluidRegistry.getFluid(id)) + Gendustry.logDebug("Fluid %s already registered, using existing (%s)", id, FluidRegistry.getFluid(id)) false } else { - Gendustry.logInfo("Registering fluid %s", id) + Gendustry.logDebug("Registering fluid %s", id) val newFluid = new Fluid(id) newFluid.setUnlocalizedName((Misc.getActiveModId + "." + id).toLowerCase) newFluid.setLuminosity(luminosity) diff --git a/src/net/bdew/gendustry/config/loader/Loader.scala b/src/net/bdew/gendustry/config/loader/Loader.scala index 0e3ed5f..b3e162e 100644 --- a/src/net/bdew/gendustry/config/loader/Loader.scala +++ b/src/net/bdew/gendustry/config/loader/Loader.scala @@ -34,7 +34,7 @@ class Loader extends RecipeLoader with GenericConfigLoader with LootListLoader { val resolved = getConcreteStack(ref, cnt) if (resolved.getItemDamage == OreDictionary.WILDCARD_VALUE) { resolved.setItemDamage(0) - Gendustry.logInfo("meta/damage is unset in %s, defaulting to 0", ref) + Gendustry.logDebug("meta/damage is unset in %s, defaulting to 0", ref) } resolved } @@ -51,36 +51,36 @@ class Loader extends RecipeLoader with GenericConfigLoader with LootListLoader { case RsMutagen(st, mb) => for (x <- getAllConcreteStacks(st)) { MutagenSources.register(x, mb) - Gendustry.logInfo("Added Mutagen source %s -> %d mb", x, mb) + Gendustry.logDebug("Added Mutagen source %s -> %d mb", x, mb) } case RsLiquidDNA(st, mb) => for (x <- getAllConcreteStacks(st)) { LiquidDNASources.register(x, mb) - Gendustry.logInfo("Added Liquid DNA source %s -> %d mb", x, mb) + Gendustry.logDebug("Added Liquid DNA source %s -> %d mb", x, mb) } case RsProtein(st, mb) => for (x <- getAllConcreteStacks(st)) { ProteinSources.register(x, mb) - Gendustry.logInfo("Added Protein source %s -> %d mb", x, mb) + Gendustry.logDebug("Added Protein source %s -> %d mb", x, mb) } case RsAssembly(rec, id, power, out, cnt) => - Gendustry.logInfo("Adding assembly recipe: %s + %d mj => %s * %d", rec, power, out, cnt) + Gendustry.logDebug("Adding assembly recipe: %s + %d mj => %s * %d", rec, power, out, cnt) val outStack = getConcreteStack(out, cnt) val stacks = rec.map { case (c, n) => val s = getConcreteStackNoWildcard(currCharMap(c), n) - Gendustry.logInfo("%s -> %s", c, s) + Gendustry.logDebug("%s -> %s", c, s) s } - Gendustry.logInfo("Output: %s", outStack) + Gendustry.logDebug("Output: %s", outStack) AssemblyRecipeManager.INSTANCE.addRecipe(id, power, outStack, stacks: _*) - Gendustry.logInfo("Done") + Gendustry.logDebug("Done") case RsCentrifuge(stack, out, time) => - Gendustry.logInfo("Adding centrifuge recipe: %s => %s", stack, out) + Gendustry.logDebug("Adding centrifuge recipe: %s => %s", stack, out) // forestry API is stupid and requires a hashmap, build one for it val outStacks = new java.util.HashMap[ItemStack, Integer] @@ -90,10 +90,10 @@ class Loader extends RecipeLoader with GenericConfigLoader with LootListLoader { RecipeManagers.centrifugeManager.addRecipe(time, inStack, outStacks) - Gendustry.logInfo("Done %s -> %s", inStack, outStacks) + Gendustry.logDebug("Done %s -> %s", inStack, outStacks) case RsSqueezer(in, fluid, time, out, chance) => - Gendustry.logInfo("Adding squeezer recipe: %s => %s + %s", in, fluid, out) + Gendustry.logDebug("Adding squeezer recipe: %s => %s + %s", in, fluid, out) val inStack = getConcreteStackNoWildcard(in) val outStack = if (out != null) getConcreteStackNoWildcard(out) else null @@ -101,7 +101,7 @@ class Loader extends RecipeLoader with GenericConfigLoader with LootListLoader { RecipeManagers.squeezerManager.addRecipe(time, Array(inStack), outFluid, outStack, chance) - Gendustry.logInfo("Done %s -> %s + %s", inStack, outStack, outFluid) + Gendustry.logDebug("Done %s -> %s + %s", inStack, outStack, outFluid) case x: RsMutation => mutations +:= x diff --git a/src/net/bdew/gendustry/custom/BeeSpecies.scala b/src/net/bdew/gendustry/custom/BeeSpecies.scala index 970c511..6130964 100644 --- a/src/net/bdew/gendustry/custom/BeeSpecies.scala +++ b/src/net/bdew/gendustry/custom/BeeSpecies.scala @@ -75,15 +75,15 @@ class BeeSpecies(cfg: ConfigSection, ident: String) extends IAlleleBeeSpecies { TuningLoader.loader.resolveLootList(cfg.getRaw(name, classOf[EntryLootList])) .toMap.map(x => x._2 -> new Integer(x._1)) - Gendustry.logInfo("Resolving products list for bee '%s'...", ident) + Gendustry.logDebug("Resolving products list for bee '%s'...", ident) val products = prepareLootList("Products") override val getProducts = products.asJava - products.foreach(x => Gendustry.logInfo(" [%d%%] %s", x._2, x._1)) + products.foreach(x => Gendustry.logDebug(" [%d%%] %s", x._2, x._1)) - Gendustry.logInfo("Resolving specialty list for bee '%s'...", ident) + Gendustry.logDebug("Resolving specialty list for bee '%s'...", ident) val specialty = prepareLootList("Specialty") override val getSpecialty = specialty.asJava - specialty.foreach(x => Gendustry.logInfo(" [%d%%] %s", x._2, x._1)) + specialty.foreach(x => Gendustry.logDebug(" [%d%%] %s", x._2, x._1)) override val isNocturnal = cfg.getBoolean("Nocturnal") override val getRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees").asInstanceOf[IBeeRoot] diff --git a/src/net/bdew/gendustry/custom/CustomContent.scala b/src/net/bdew/gendustry/custom/CustomContent.scala index 4b82525..9bb6dd2 100644 --- a/src/net/bdew/gendustry/custom/CustomContent.scala +++ b/src/net/bdew/gendustry/custom/CustomContent.scala @@ -27,10 +27,10 @@ object CustomContent { var mySpecies = List.empty[BeeSpecies] def registerBranches() { - Gendustry.logInfo("Registering branches") + Gendustry.logDebug("Registering branches") val added = (Tuning.getOrAddSection("Branches").filterType(classOf[ConfigSection]) collect { case (_, cfg) => - Gendustry.logInfo("%s -> %s (%s)", cfg.getString("Parent"), cfg.getString("UID"), cfg.getString("Scientific")) + Gendustry.logDebug("%s -> %s (%s)", cfg.getString("Parent"), cfg.getString("UID"), cfg.getString("Scientific")) val cls = reg.createAndRegisterClassification(EnumClassLevel.GENUS, cfg.getString("UID"), cfg.getString("Scientific")) reg.getClassification("family." + cfg.getString("Parent")).addMemberGroup(cls) }).size @@ -38,11 +38,11 @@ object CustomContent { } def registerSpecies() { - Gendustry.logInfo("Registering bees") + Gendustry.logDebug("Registering bees") val added = (Tuning.getOrAddSection("Bees").filterType(classOf[ConfigSection]) collect { case (uid, cfg) => val species = new BeeSpecies(cfg, uid) - Gendustry.logInfo("Registering %s", species.getUID) + Gendustry.logDebug("Registering %s", species.getUID) mySpecies +:= species reg.registerAllele(species) }).size @@ -55,12 +55,12 @@ object CustomContent { .asInstanceOf[IAlleleBeeSpecies] def registerMutations() { - Gendustry.logInfo("Registering mutations") + Gendustry.logDebug("Registering mutations") val added = TuningLoader.loader.mutations count { st => try { - Gendustry.logInfo("Registering mutation %s + %s = %s", st.parent1, st.parent2, st.result) + Gendustry.logDebug("Registering mutation %s + %s = %s", st.parent1, st.parent2, st.result) val mutation = new BeeMutation( lookupBeeSpecies(st.parent1), diff --git a/src/net/bdew/gendustry/misc/GeneticsCache.scala b/src/net/bdew/gendustry/misc/GeneticsCache.scala index 69c98ca..8964857 100644 --- a/src/net/bdew/gendustry/misc/GeneticsCache.scala +++ b/src/net/bdew/gendustry/misc/GeneticsCache.scala @@ -62,8 +62,8 @@ object GeneticsCache { speciesUsedMutations(mutation.getAllele1.asInstanceOf[IAlleleSpecies]) += mutation } - Gendustry.logInfo("Mutations with multiple results from a single combination:") - Gendustry.logInfo("(This is not an error, no need to report it to anybody)") + Gendustry.logDebug("Mutations with multiple results from a single combination:") + Gendustry.logDebug("(This is not an error, no need to report it to anybody)") speciesUsedMutations foreach { case (sp1, mutations) => // First make a list of partner -> result @@ -83,12 +83,12 @@ object GeneticsCache { (if (Option(mutation.getSpecialConditions).map(_.size).getOrElse(0) > 0) "*" else "") } mkString ", " // And print it out - Gendustry.logInfo("%s + %s => [%s]", sp1.getName, partner.getName, names) + Gendustry.logDebug("%s + %s => [%s]", sp1.getName, partner.getName, names) } } - Gendustry.logInfo("%d mutation outputs", speciesResultMutations.size) - Gendustry.logInfo("%d mutation inputs", speciesUsedMutations.size) + Gendustry.logInfo("Cached %d mutation outputs", speciesResultMutations.size) + Gendustry.logInfo("Cached %d mutation inputs", speciesUsedMutations.size) for (species <- Misc.filterType(AlleleManager.alleleRegistry.getRegisteredAlleles.values(), classOf[IAlleleSpecies])) { if (species.getRoot.getTemplate(species.getUID) == null) { @@ -103,7 +103,6 @@ object GeneticsCache { geneSamples ++= speciesChromosomes.keys - Gendustry.logInfo("%d chromosomes", speciesChromosomes.size) - Gendustry.logInfo("Done") + Gendustry.logInfo("Cached %d chromosomes", speciesChromosomes.size) } }