= Updated utils and logging subsystem formatting
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user