|
@@ -102,6 +102,7 @@ public class LoggingManager implements ConfigChangeListener {
|
102
|
102
|
"EEEE MMMM dd, yyyy - HH:mm:ss");
|
103
|
103
|
/** Object for synchronising access to the date forma.t */
|
104
|
104
|
private static final Object FORMAT_LOCK = new Object();
|
|
105
|
+ private static final String timestamp = "[dd/MM/yyyy HH:mm:ss]";
|
105
|
106
|
/** This plugin's plugin info. */
|
106
|
107
|
private final String domain;
|
107
|
108
|
private final PluginInfo pluginInfo;
|
|
@@ -124,8 +125,6 @@ public class LoggingManager implements ConfigChangeListener {
|
124
|
125
|
private boolean channelmodeprefix;
|
125
|
126
|
private boolean autobackbuffer;
|
126
|
127
|
private boolean backbufferTimestamp;
|
127
|
|
- /** Cached string settings. */
|
128
|
|
- private String timestamp;
|
129
|
128
|
private String colour;
|
130
|
129
|
/** Cached int settings. */
|
131
|
130
|
private int historyLines;
|
|
@@ -489,20 +488,8 @@ public class LoggingManager implements ConfigChangeListener {
|
489
|
488
|
final StringBuilder finalLine = new StringBuilder();
|
490
|
489
|
|
491
|
490
|
if (addtime) {
|
492
|
|
- String dateString;
|
493
|
|
- try {
|
494
|
|
- final DateFormat dateFormat = new SimpleDateFormat(timestamp);
|
495
|
|
- dateString = dateFormat.format(new Date()).trim();
|
496
|
|
- } catch (IllegalArgumentException iae) {
|
497
|
|
- // Default to known good format
|
498
|
|
- final DateFormat dateFormat = new SimpleDateFormat("[dd/MM/yyyy HH:mm:ss]");
|
499
|
|
- dateString = dateFormat.format(new Date()).trim();
|
500
|
|
-
|
501
|
|
- eventBus.publishAsync(new UserErrorEvent(ErrorLevel.LOW, iae,
|
502
|
|
- "Dateformat String '" + timestamp + "' is invalid. For more information: "
|
503
|
|
- + "http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html",
|
504
|
|
- ""));
|
505
|
|
- }
|
|
491
|
+ final DateFormat dateFormat = new SimpleDateFormat(timestamp);
|
|
492
|
+ final String dateString = dateFormat.format(new Date()).trim();
|
506
|
493
|
finalLine.append(dateString);
|
507
|
494
|
finalLine.append(' ');
|
508
|
495
|
}
|
|
@@ -608,7 +595,6 @@ public class LoggingManager implements ConfigChangeListener {
|
608
|
595
|
channelmodeprefix = config.getOptionBool(domain, "general.channelmodeprefix");
|
609
|
596
|
autobackbuffer = config.getOptionBool(domain, "backbuffer.autobackbuffer");
|
610
|
597
|
backbufferTimestamp = config.getOptionBool(domain, "backbuffer.timestamp");
|
611
|
|
- timestamp = config.getOption(domain, "general.timestamp");
|
612
|
598
|
historyLines = config.getOptionInt(domain, "history.lines");
|
613
|
599
|
colour = config.getOption(domain, "backbuffer.colour");
|
614
|
600
|
backbufferLines = config.getOptionInt(domain, "backbuffer.lines");
|
|
@@ -638,10 +624,6 @@ public class LoggingManager implements ConfigChangeListener {
|
638
|
624
|
pluginInfo.getDomain(), "general.addtime", "Timestamp logs",
|
639
|
625
|
"Should a timestamp be added to the log files?",
|
640
|
626
|
manager.getConfigManager(), manager.getIdentity()));
|
641
|
|
- general.addSetting(new PreferencesSetting(PreferencesType.TEXT,
|
642
|
|
- pluginInfo.getDomain(), "general.timestamp", "Timestamp format",
|
643
|
|
- "The String to pass to 'SimpleDateFormat' to format the timestamp",
|
644
|
|
- manager.getConfigManager(), manager.getIdentity()));
|
645
|
627
|
general.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
|
646
|
628
|
pluginInfo.getDomain(), "general.stripcodes", "Strip Control Codes",
|
647
|
629
|
"Remove known irc control codes from lines before saving?",
|