Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2011-08-02 16:05:44 -0400
committerRyan D. Brooks2011-08-02 16:05:44 -0400
commit5618fe9dd7eb79ae3118d1e874aace2ce208bec8 (patch)
treebc6fce7bf67baca7c3ecb0279133657eb90eb66b /plugins/org.eclipse.osee.ote.ui.message
parent38f5425454f60d085a2ad10b340b63a5c1562378 (diff)
downloadorg.eclipse.osee-5618fe9dd7eb79ae3118d1e874aace2ce208bec8.tar.gz
org.eclipse.osee-5618fe9dd7eb79ae3118d1e874aace2ce208bec8.tar.xz
org.eclipse.osee-5618fe9dd7eb79ae3118d1e874aace2ce208bec8.zip
refactor: Replace OseeLog.log() calls that use String.format with OseeLog.logf
Diffstat (limited to 'plugins/org.eclipse.osee.ote.ui.message')
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java20
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java8
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java5
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java10
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java6
-rw-r--r--plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java6
6 files changed, 27 insertions, 28 deletions
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java
index b41c96ad69..5f93152571 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/DetailsBox.java
@@ -294,8 +294,8 @@ public class DetailsBox implements IRegistryEventListener {
String bundleName = element.getContributor().getName();
Bundle bundle = Platform.getBundle(bundleName);
if (bundle == null) {
- OseeLog.log(DetailsBox.class, Level.SEVERE, String.format(
- "no bundle found for name %s while handling extension element %s", bundleName, element.getName()));
+ OseeLog.logf(DetailsBox.class, Level.SEVERE,
+ "no bundle found for name %s while handling extension element %s", bundleName, element.getName());
return;
}
try {
@@ -311,20 +311,20 @@ public class DetailsBox implements IRegistryEventListener {
newTab.setControl(provider);
detailsProviderMap.put(element.getDeclaringExtension().getUniqueIdentifier(), newTab);
} catch (Exception ex) {
- OseeLog.log(DetailsBox.class, Level.SEVERE, String.format("failed to install details provider"));
+ OseeLog.logf(DetailsBox.class, Level.SEVERE, "failed to install details provider");
}
} catch (ClassCastException ex) {
- OseeLog.log(
+ OseeLog.logf(
DetailsBox.class,
Level.SEVERE,
- String.format("the class named %s is not a subclass of %s", className,
- DetailsProvider.class.getName()));
+ "the class named %s is not a subclass of %s", className,
+ DetailsProvider.class.getName());
} catch (ClassNotFoundException ex) {
- OseeLog.log(DetailsBox.class, Level.SEVERE,
- String.format("no class found named %s in bundle %s", className, bundleName));
+ OseeLog.logf(DetailsBox.class, Level.SEVERE,
+ "no class found named %s in bundle %s", className, bundleName);
} catch (NoSuchMethodException ex) {
- OseeLog.log(DetailsBox.class, Level.SEVERE,
- String.format("can't find appropriate constructor for %s", className));
+ OseeLog.logf(DetailsBox.class, Level.SEVERE,
+ "can't find appropriate constructor for %s", className);
}
}
}
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java
index 917ee653c9..130216924a 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/WatchView.java
@@ -628,7 +628,7 @@ public final class WatchView extends ViewPart implements IActionable, IMessageDi
public void addWatchMessage(final AddWatchParameter parameter) {
for (String message : parameter.getMessages()) {
Collection<ElementPath> elements = parameter.getMessageElements(message);
- OseeLog.log(Activator.class, Level.FINEST, String.format("Watch request for message %s", message));
+ OseeLog.logf(Activator.class, Level.FINEST, "Watch request for message %s", message);
try {
if (elements == null) {
elements = new ArrayList<ElementPath>();
@@ -684,12 +684,12 @@ public final class WatchView extends ViewPart implements IActionable, IMessageDi
}
try {
if (Benchmark.isBenchmarkingEnabled()) {
- OseeLog.log(
+ OseeLog.logf(
Activator.class,
Level.INFO,
- String.format("%s: # samples=%d, max=%d, min=%d, avg=%d", benchMark.getName(),
+ "%s: # samples=%d, max=%d, min=%d, avg=%d", benchMark.getName(),
benchMark.getTotalSamples(), benchMark.getLongestSample(), benchMark.getShortestSample(),
- benchMark.getAverage()));
+ benchMark.getAverage());
}
} catch (Throwable t) {
OseeLog.log(Activator.class, Level.WARNING, "Exception during disconnect", t);
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java
index 9e4cbcc7ae..6f61338509 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/action/SetValueAction.java
@@ -139,9 +139,8 @@ public class SetValueAction extends Action {
final String val = dialog.getValue();
msgNode.getSubscription().setElementValue(path, val);
} catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE,
- String.format("Unable to set the %s element for the message %s", element.getName(), msg.getName()),
- ex);
+ OseeLog.logf(Activator.class, Level.SEVERE, ex, "Unable to set the %s element for the message %s",
+ element.getName(), msg.getName());
MessageDialog.openError(Displays.getActiveShell(), "Error", "Could not set value");
}
}
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java
index 7856297389..a213c2eb6c 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/CsvTransform.java
@@ -41,8 +41,8 @@ public class CsvTransform extends Action {
File file = new File(getter.getPath());
File csvFile = new File(getter.getPath() + "_transformed.csv");
if (!file.exists()) {
- OseeLog.log(Activator.class, Level.SEVERE,
- String.format("[%s] does not exist. Exiting the csv transformer.", file.toString()));
+ OseeLog.logf(Activator.class, Level.SEVERE,
+ "[%s] does not exist. Exiting the csv transformer.", file.toString());
}
try {
@@ -68,9 +68,9 @@ public class CsvTransform extends Action {
BufferedWriter bw = new BufferedWriter(new FileWriter(csvFile));
bw.write("time,");
if (columnsArray.length >= 254) {
- OseeLog.log(CsvTransform.class, Level.SEVERE, String.format(
+ OseeLog.logf(CsvTransform.class, Level.SEVERE,
"%d columns have been lost in the CsvTransform because there is a limitation of 256 rows in excel.",
- (columnsArray.length - 254)));
+ (columnsArray.length - 254));
}
for (int i = 0; i < columnsArray.length && i < 254; i++) {
bw.write(columnsArray[i]);
@@ -113,7 +113,7 @@ public class CsvTransform extends Action {
bw.flush();
bw.close();
- OseeLog.log(Activator.class, Level.INFO, String.format("Wrote [%s].", csvFile.toString()));
+ OseeLog.logf(Activator.class, Level.INFO, "Wrote [%s].", csvFile.toString());
} catch (Throwable ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java
index f45071419d..68d2b6e134 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCSVConversion.java
@@ -37,8 +37,8 @@ public class RunCSVConversion implements IApplication {
File file = new File(filepath);
File csvFile = new File(filepath + ".csv");
if (!file.exists()) {
- OseeLog.log(Activator.class, Level.SEVERE,
- String.format("[%s] does not exist. Exiting the csv processor.", file.toString()));
+ OseeLog.logf(Activator.class, Level.SEVERE,
+ "[%s] does not exist. Exiting the csv processor.", file.toString());
return null;
}
@@ -53,7 +53,7 @@ public class RunCSVConversion implements IApplication {
reader.parse(new InputSource(new FileInputStream(file)));
Lib.writeBytesToFile(csv.getBuilder().toString().getBytes(), csvFile);
- OseeLog.log(Activator.class, Level.INFO, String.format("Wrote [%s].", csvFile.toString()));
+ OseeLog.logf(Activator.class, Level.INFO, "Wrote [%s].", csvFile.toString());
return IApplication.EXIT_OK;
}
diff --git a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java
index f1217db0c5..7f9973966f 100644
--- a/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java
+++ b/plugins/org.eclipse.osee.ote.ui.message/src/org/eclipse/osee/ote/ui/message/watch/recording/xform/RunCsvAction.java
@@ -56,8 +56,8 @@ public class RunCsvAction extends Action {
File file = new File(getter.getPath());
File csvFile = new File(getter.getPath() + ".csv");
if (!file.exists()) {
- OseeLog.log(Activator.class, Level.SEVERE,
- String.format("[%s] does not exist. Exiting the csv processor.", file.toString()));
+ OseeLog.logf(Activator.class, Level.SEVERE,
+ "[%s] does not exist. Exiting the csv processor.", file.toString());
}
XMLReader reader;
@@ -72,7 +72,7 @@ public class RunCsvAction extends Action {
reader.parse(new InputSource(new FileInputStream(file)));
Lib.writeBytesToFile(csv.getBuilder().toString().getBytes(), csvFile);
- OseeLog.log(Activator.class, Level.INFO, String.format("Wrote [%s].", csvFile.toString()));
+ OseeLog.logf(Activator.class, Level.INFO, "Wrote [%s].", csvFile.toString());
} catch (SAXException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
} catch (FileNotFoundException ex) {

Back to the top