= 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
+1 -1
View File
@@ -71,7 +71,7 @@ public class KittyTrackedLong extends DatabaseTrackedObject
catch(Exception e)
{
tracked = 0;
GlobalLog.Error(LogFilter.Core, "Falling back to default of 0 due to failure to deserialize long with database ID " + identifier);
GlobalLog.error(LogFilter.Core, "Falling back to default of 0 due to failure to deserialize long with database ID " + identifier);
}
}
else
+1 -1
View File
@@ -49,7 +49,7 @@ public class KittyTrackedString extends DatabaseTrackedObject
}
else
{
GlobalLog.Log(LogFilter.Database, "String had null or empty value with identifier: " + identifier);
GlobalLog.log(LogFilter.Database, "String had null or empty value with identifier: " + identifier);
string = "";
markDirty();
}
+2 -2
View File
@@ -87,7 +87,7 @@ public class KittyUser extends DatabaseTrackedObject
String[] strings = prepareFromString(string);
if(strings.length < 2)
{
GlobalLog.Log(LogFilter.Database, "Upgrading user " + name + " to include 'role' in DB");
GlobalLog.log(LogFilter.Database, "Upgrading user " + name + " to include 'role' in DB");
// Mark ourselves dirty to re-write the role information stored in the user.
// Just uses defaults from earlier again.
@@ -101,7 +101,7 @@ public class KittyUser extends DatabaseTrackedObject
}
catch (NumberFormatException e)
{
GlobalLog.Warn(LogFilter.Database, "Invalid user data for user " + name + "! "
GlobalLog.warn(LogFilter.Database, "Invalid user data for user " + name + "! "
+ "Starting over at 0 beans with a general role!");
// We don't need to specify the role at this point because it is set at this point.
+4 -4
View File
@@ -90,7 +90,7 @@ public class Response
// Queues a standard text-based message response to the channel that issued the command.
public void send(String toRespondWith)
{
GlobalLog.Log(LogFilter.Response, "Sending response: " + toRespondWith);
GlobalLog.log(LogFilter.Response, "Sending response: " + toRespondWith);
if(toRespondWith.length() > discordMessageMax)
{
event.getChannel().sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!").queue();
@@ -119,7 +119,7 @@ public class Response
// Immediately dispatches the message to the channel that issued the command.
public void sendImmediate(String toRespondWith)
{
GlobalLog.Log(LogFilter.Response, "Sending immediate response: " + toRespondWith);
GlobalLog.log(LogFilter.Response, "Sending immediate response: " + toRespondWith);
if(toRespondWith.length() > discordMessageMax)
{
event.getChannel().sendMessage(toRespondWith.substring(0, kittyMessageMax) + "\n\nI think that's enough!");
@@ -133,14 +133,14 @@ public class Response
// Queues a file response to the channel that issued the command.
public void sendFile(File toRespondWith, String extension)
{
GlobalLog.Log(LogFilter.Response, "Sending file response");
GlobalLog.log(LogFilter.Response, "Sending file response");
event.getChannel().sendFile(toRespondWith, "return." + extension).queue();
}
// Queues an input stream response to the channel that issued the command.
public void sendFile(InputStream in, String extension)
{
GlobalLog.Log(LogFilter.Response, "Sending input stream response");
GlobalLog.log(LogFilter.Response, "Sending input stream response");
event.getChannel().sendFile(in, "return." + extension).queue();
}
}
+4 -4
View File
@@ -93,8 +93,8 @@ public class TaggedPairStore
Map.Entry internalPair = (Map.Entry)internal.next();
String key = (String)internalPair.getKey();
String value = (String)internalPair.getValue();
key = StringUtils.ReEscape(key);
value = StringUtils.ReEscape(value);
key = StringUtils.reEscape(key);
value = StringUtils.reEscape(value);
if(key.endsWith("\\r"))
{
@@ -160,8 +160,8 @@ public class TaggedPairStore
String key = line.substring(0, splitPos);
String value = line.substring(splitPos + PairSplit.length());
key = StringUtils.UnEscape(key);
value = StringUtils.UnEscape(value);
key = StringUtils.unEscape(key);
value = StringUtils.unEscape(value);
taggedPairs.get(sectionName).putIfAbsent(key, value);
allPairs.putIfAbsent(key, value);