chore: Exchange debug log levels & component-ify a few messages (#1342)

This commit is contained in:
NotMyFault
2021-10-17 14:50:42 +02:00
committed by GitHub
parent 3a952e1938
commit 27865dc785
28 changed files with 49 additions and 52 deletions

View File

@ -1281,7 +1281,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
List<TracingExtent> tracingExtents = getActiveTracingExtents();
assert actor != null;
if (tracingExtents.isEmpty()) {
actor.printError(TextComponent.of("worldedit.trace.no-tracing-extents"));
actor.print(TextComponent.of("worldedit.trace.no-tracing-extents"));
return;
}
// find the common stacks

View File

@ -523,7 +523,7 @@ public class RegionCommands {
HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0));
float[] changed = heightMap.applyFilter(filter, iterations);
int affected = heightMap.applyChanges(changed, snowBlockCount);
actor.printInfo(Caption.of("worldedit.snowsmooth.changed", TextComponent.of(affected)));
actor.print(Caption.of("worldedit.snowsmooth.changed", TextComponent.of(affected)));
return affected;
}

View File

@ -432,7 +432,7 @@ public class SchematicCommands {
) throws WorldEditException {
//FAWE end
if (worldEdit.getPlatformManager().queryCapability(Capability.GAME_HOOKS).getDataVersion() == -1) {
actor.printError(TranslatableComponent.of("worldedit.schematic.unsupported-minecraft-version"));
actor.print(TranslatableComponent.of("worldedit.schematic.unsupported-minecraft-version"));
return;
}

View File

@ -226,7 +226,7 @@ public class ToolCommands {
)
@CommandPermissions("worldedit.tool.inspect")
public void inspectBrush(Player player, LocalSession session) throws WorldEditException {
setTool(player, session, new InspectBrush(), "worldedit.tool.info.equip");
setTool(player, session, new InspectBrush(), "worldedit.tool.inspect.equip");
}
//FAWE end

View File

@ -197,7 +197,7 @@ public class WorldEditCommands {
if (hookMode != null) {
newMode = hookMode == HookMode.ACTIVE;
if (newMode == previousMode) {
actor.printError(Caption.of(previousMode
actor.print(Caption.of(previousMode
? "worldedit.trace.active.already"
: "worldedit.trace.inactive.already"));
return;
@ -206,7 +206,7 @@ public class WorldEditCommands {
newMode = !previousMode;
}
session.setTracingActions(newMode);
actor.printInfo(Caption.of(newMode ? "worldedit.trace.active" : "worldedit.trace.inactive"));
actor.print(Caption.of(newMode ? "worldedit.trace.active" : "worldedit.trace.inactive"));
}
@Command(

View File

@ -442,16 +442,16 @@ public interface Player extends Entity, Actor {
getSession().setClipboard(holder);
}
} catch (FaweClipboardVersionMismatchException e) {
printError(Caption.of("fawe.error.clipboard.on.disk.version.mismatch"));
print(Caption.of("fawe.error.clipboard.on.disk.version.mismatch"));
} catch (RuntimeException e) {
printError(Caption.of("fawe.error.clipboard.invalid"));
print(Caption.of("fawe.error.clipboard.invalid"));
e.printStackTrace();
print(Caption.of("fawe.error.stacktrace"));
print(Caption.of("fawe.error.clipboard.load.failure"));
print(Caption.of("fawe.error.clipboard.invalid.info", file.getName(), file.length()));
print(Caption.of("fawe.error.stacktrace"));
} catch (Exception e) {
printError(Caption.of("fawe.error.clipboard.invalid"));
print(Caption.of("fawe.error.clipboard.invalid"));
e.printStackTrace();
print(Caption.of("fawe.error.stacktrace"));
print(Caption.of("fawe.error.no-failure"));

View File

@ -755,7 +755,7 @@ public final class PlatformCommandManager {
}
} catch (ConditionFailedException e) {
if (e.getCondition() instanceof PermissionCondition) {
actor.printError(Caption.of(
actor.print(Caption.of(
"fawe.error.no-perm",
StringMan.getString(((PermissionCondition) e.getCondition()).getPermissions())
));
@ -911,7 +911,7 @@ public final class PlatformCommandManager {
suggestions = commandManager.getSuggestions(access, argStrings);
} catch (Throwable t) { // catch errors which are *not* command exceptions generated by parsers/suggesters
if (!(t instanceof CommandException)) {
LOGGER.debug("Unexpected error occurred while generating suggestions for input: " + arguments, t);
LOGGER.error("Unexpected error occurred while generating suggestions for input: {}", arguments, t);
return;
}
throw t;

View File

@ -213,7 +213,7 @@ public class AbstractDelegateExtent implements Extent {
Extent next = ((AbstractDelegateExtent) extent).getExtent();
new ExtentTraverser(this).setNext(next);
} else {
LOGGER.debug("Cannot disable queue");
LOGGER.error("Cannot disable queue");
}
}

View File

@ -122,7 +122,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
} else if (dataVersion < liveDataVersion) {
fixer = platform.getDataFixer();
if (fixer != null) {
LOGGER.debug("Schematic was made in an older Minecraft version ({} < {}), will attempt DFU.",
LOGGER.info("Schematic was made in an older Minecraft version ({} < {}), will attempt DFU.",
dataVersion, liveDataVersion
);
} else {

View File

@ -39,7 +39,7 @@ public class SchematicsEventListener {
try {
Files.createDirectories(config.resolve(event.getConfiguration().saveDir));
} catch (FileAlreadyExistsException e) {
LOGGER.debug("Schematic directory exists as file. Possible symlink.", e);
LOGGER.info("Schematic directory exists as file. Possible symlink.", e);
} catch (IOException e) {
LOGGER.warn("Failed to create schematics directory", e);
}

View File

@ -132,7 +132,7 @@ public final class ChunkDeleter {
private boolean runBatch(ChunkDeletionInfo.ChunkBatch chunkBatch) {
int chunkCount = chunkBatch.getChunkCount();
LOGGER.debug("Processing deletion batch with {} chunks.", chunkCount);
LOGGER.info("Processing deletion batch with {} chunks.", chunkCount);
final Map<Path, Stream<BlockVector2>> regionToChunkList = groupChunks(chunkBatch);
BiPredicate<RegionAccess, BlockVector2> predicate = createPredicates(chunkBatch.deletionPredicates);
shouldPreload = chunkBatch.chunks == null;
@ -269,10 +269,10 @@ public final class ChunkDeleter {
region.deleteChunk(chunk);
totalChunksDeleted++;
if (debugRate != 0 && totalChunksDeleted % debugRate == 0) {
LOGGER.debug("Deleted {} chunks so far.", totalChunksDeleted);
LOGGER.info("Deleted {} chunks so far.", totalChunksDeleted);
}
} else {
LOGGER.debug("Chunk did not match predicates: " + chunk);
LOGGER.warn("Chunk did not match predicates: {}", chunk);
}
}
return true;

View File

@ -119,7 +119,7 @@ public final class BundledBlockData {
if (url == null) {
throw new IOException("Could not find blocks.json");
}
LOGGER.debug("Using {} for bundled block data.", url);
LOGGER.info("Using {} for bundled block data.", url);
String data = Resources.toString(url, Charset.defaultCharset());
List<BlockEntry> entries = gson.fromJson(data, new TypeToken<List<BlockEntry>>() {
}.getType());

View File

@ -104,7 +104,7 @@ public final class BundledItemData {
if (url == null) {
throw new IOException("Could not find items.json");
}
LOGGER.debug("Using {} for bundled item data.", url);
LOGGER.info("Using {} for bundled item data.", url);
String data = Resources.toString(url, Charset.defaultCharset());
List<ItemEntry> entries = gson.fromJson(data, new TypeToken<List<ItemEntry>>() {
}.getType());

View File

@ -149,7 +149,8 @@ public final class LegacyMapper {
// if it's still null, both fixer and default failed
if (state == null) {
LOGGER.debug("Unknown block: " + value);
LOGGER.error("Unknown block: {}. Neither the DataFixer nor defaulting worked to recognize this block.",
value);
} else {
// it's not null so one of them succeeded, now use it
blockToStringMap.put(state, id);
@ -185,7 +186,7 @@ public final class LegacyMapper {
type = ItemTypes.get(value);
}
if (type == null) {
LOGGER.debug("Unknown item: " + value);
LOGGER.error("Unknown item: {}. Neither the DataFixer nor defaulting worked to recognize this item.", value);
} else {
try {
itemMap.put(getCombinedId(id), type);