= Updated utils and logging subsystem formatting

This commit is contained in:
Matthew Cech
2019-06-19 22:14:13 -07:00
parent 5e531a19b7
commit 06317a4528
58 changed files with 205 additions and 202 deletions
+2 -2
View File
@@ -63,8 +63,8 @@ public class CommandBlurry extends Command
postProcessed = new File(name);
res.sendFile(postProcessed, "png");
ImageUtils.BlockingFileDelete(preProcessed);
ImageUtils.BlockingFileDelete(postProcessed);
ImageUtils.blockingFileDelete(preProcessed);
ImageUtils.blockingFileDelete(postProcessed);
}
private static void ApplySnap(BufferedImage image, String name) throws IOException
+1 -1
View File
@@ -42,7 +42,7 @@ public class CommandBoop extends Command
}
catch (NumberFormatException e)
{
GlobalLog.Warn(LogFilter.Command, "No valid value was found for boops! Starting over at 0!");
GlobalLog.warn(LogFilter.Command, "No valid value was found for boops! Starting over at 0!");
boops = 0;
markDirty();
}
+3 -3
View File
@@ -54,7 +54,7 @@ public class CommandCatch extends Command
catcheeFile = new File(catchFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder("assets/catch/frames/", "catch ", 92, 18);
builder.Overlay(ImageIO.read(catcheeFile), name);
builder.overlay(ImageIO.read(catcheeFile), name);
}
catch (IOException e)
{
@@ -65,7 +65,7 @@ public class CommandCatch extends Command
res.sendFile(catchFile, "gif");
// Thread cleanup...
ImageUtils.BlockingFileDelete(catchFile);
ImageUtils.BlockingFileDelete(catcheeFile);
ImageUtils.blockingFileDelete(catchFile);
ImageUtils.blockingFileDelete(catcheeFile);
}
}
+1 -1
View File
@@ -23,7 +23,7 @@ public class CommandColiru extends Command
return;
}
res.send(compiler.compileCPlus(input.args));
res.send(compiler.compileCPlusPlus(input.args));
}
}
+2 -2
View File
@@ -32,7 +32,7 @@ public class CommandColor extends Command
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
// First, try and parse out the color to make sure we can even get it.
ColorData colorData = theColorAPI.LookupHex(input.args.trim());
ColorData colorData = theColorAPI.lookupHex(input.args.trim());
// Verify the color was even found
if(colorData == null)
@@ -77,7 +77,7 @@ public class CommandColor extends Command
// Send then delete the temp local files
res.send(response);
ImageUtils.BlockingFileDelete(file);
ImageUtils.blockingFileDelete(file);
};
}
+2 -2
View File
@@ -63,13 +63,13 @@ public class CommandHelpBuilder extends Command {
}
catch (FileNotFoundException e)
{
GlobalLog.Error(e.toString());
GlobalLog.error(e.toString());
return;
}
File file = new File(filename);
res.sendFile(file, "txt");
ImageUtils.BlockingFileDelete(file);
ImageUtils.blockingFileDelete(file);
}
// Generates the section for a specific role, optionally adding spacing after for another section
+2 -2
View File
@@ -32,7 +32,7 @@ public class CommandLeaderboard extends Command
public void onRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
{
// Start by force-flushing. We need to be up-to-date.
GlobalLog.Log("Flushed database for " + DatabaseManager.instance.upkeep() + " items.");
GlobalLog.log("Flushed database for " + DatabaseManager.instance.upkeep() + " items.");
// Get all users associated with a guild and get their bean count
String guildID = guild.uniqueID;
@@ -74,7 +74,7 @@ public class CommandLeaderboard extends Command
return (int)difference;
});
GlobalLog.Log(LogFilter.Command, "Sorted through " + users.size() + " KittyUsers for leaderboard purposes.");
GlobalLog.log(LogFilter.Command, "Sorted through " + users.size() + " KittyUsers for leaderboard purposes.");
// Configure output
final int listSize = 10;
+3 -3
View File
@@ -43,18 +43,18 @@ public class CommandMap extends Command
{
OptionParser parser = new OptionParser(input.args);
String seedStr = parser.GetOption("-s", true);
String seedStr = parser.getOption("-s", true);
if(seedStr != null)
{
seed = Long.parseLong(seedStr);
hasSeed = true;
}
String widthStr = parser.GetOption("-w", true);
String widthStr = parser.getOption("-w", true);
if(widthStr != null)
width = ValidateSize(Integer.parseInt(widthStr), MaxWidth);
String heightStr = parser.GetOption("-h", true);
String heightStr = parser.getOption("-h", true);
if(heightStr != null)
height = ValidateSize(Integer.parseInt(heightStr), MaxHeight);
}
+2 -2
View File
@@ -69,8 +69,8 @@ public class CommandPerish extends Command
postProcessed = new File(name);
res.sendFile(postProcessed, "png");
ImageUtils.BlockingFileDelete(preProcessed);
ImageUtils.BlockingFileDelete(postProcessed);
ImageUtils.blockingFileDelete(preProcessed);
ImageUtils.blockingFileDelete(postProcessed);
}
private static void ApplyTintEffect(BufferedImage image, String name) throws IOException
+2 -2
View File
@@ -48,14 +48,14 @@ public class CommandShutdown extends Command
// Force upkeep, this works so long as upkeep is on the main thread.
res.sendImmediate(LocStrings.stub("ShutdownSafe"));
DatabaseManager.instance.upkeep();
GlobalLog.Warn(LogFilter.Command, LocStrings.lookup("ShutdownSafe"));
GlobalLog.warn(LogFilter.Command, LocStrings.lookup("ShutdownSafe"));
System.exit(0);
}
else
{
res.sendImmediate(LocStrings.stub("ShutdownUnsafe"));// "``");
GlobalLog.Warn(LogFilter.Command, LocStrings.lookup("ShutdownSafe"));
GlobalLog.warn(LogFilter.Command, LocStrings.lookup("ShutdownSafe"));
System.exit(0);
}
}
+2 -2
View File
@@ -63,8 +63,8 @@ public class CommandStark extends Command
postProcessed = new File(name);
res.sendFile(postProcessed, "png");
ImageUtils.BlockingFileDelete(preProcessed);
ImageUtils.BlockingFileDelete(postProcessed);
ImageUtils.blockingFileDelete(preProcessed);
ImageUtils.blockingFileDelete(postProcessed);
}
private static void ApplySnap(BufferedImage image, String name) throws IOException
+3 -3
View File
@@ -54,7 +54,7 @@ public class CommandTeey extends Command
teeyeeFile = new File(yeeteeFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder("assets/teey/frames/", "teey ", 24, 18);
builder.Overlay(ImageIO.read(teeyeeFile), name);
builder.overlay(ImageIO.read(teeyeeFile), name);
}
catch (IOException e)
{
@@ -65,7 +65,7 @@ public class CommandTeey extends Command
res.sendFile(teeyFile, "gif");
// Thread cleanup...
ImageUtils.BlockingFileDelete(teeyFile);
ImageUtils.BlockingFileDelete(teeyeeFile);
ImageUtils.blockingFileDelete(teeyFile);
ImageUtils.blockingFileDelete(teeyeeFile);
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ public class CommandWolfram extends Command
{
File pic = new File(searcher.getWolfram(input.args));
res.sendFile(pic, "png");
ImageUtils.BlockingFileDelete(pic);
ImageUtils.blockingFileDelete(pic);
}
catch (IOException e)
{
+3 -3
View File
@@ -54,7 +54,7 @@ public class CommandYeet extends Command
yeeteeFile = new File(yeeteeFilename);
ImageOverlayBuilder builder = new ImageOverlayBuilder("assets/yeet/frames/", "yeet ", 24, 18);
builder.Overlay(ImageIO.read(yeeteeFile), name);
builder.overlay(ImageIO.read(yeeteeFile), name);
}
catch (IOException e)
{
@@ -65,7 +65,7 @@ public class CommandYeet extends Command
res.sendFile(yeetFile, "gif");
// Thread cleanup...
ImageUtils.BlockingFileDelete(yeetFile);
ImageUtils.BlockingFileDelete(yeeteeFile);
ImageUtils.blockingFileDelete(yeetFile);
ImageUtils.blockingFileDelete(yeeteeFile);
}
}