Skip to content

Commit

Permalink
add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
koentsje committed Oct 16, 2014
1 parent c5b2c9b commit c07ce46
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import java.util.Map;
import java.util.Properties;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
Expand Down Expand Up @@ -56,6 +58,12 @@ public Map<String, ConnectionProfile> loadConnectionProfiles() {
if (driverClass != null) {
profile.setDriver(driverClass);
} else {
logInfo(
"Value for " +
DRIVER_CLASS +
" in connection profile " +
profileName +
"was null. Ignoring this connection profile.");
continue;
}
String driverLocation = props.getProperty(DRIVER_LOCATION);
Expand All @@ -65,6 +73,12 @@ public Map<String, ConnectionProfile> loadConnectionProfiles() {
if (driverLocation != null) {
profile.setPath(driverLocation);
} else {
logInfo(
"Value for " +
DRIVER_LOCATION +
" in connection profile " +
currentProfile.getName() +
"was null. Ignoring this connection profile.");
continue;
}
profile.setUser(props.getProperty(USER_NAME));
Expand Down Expand Up @@ -220,4 +234,12 @@ private DriverInstance getDriver(String name) {
return DriverManager.getInstance().getDriverInstanceByName(name);
}

private void logInfo(String info) {
IStatus status = new Status(
Status.INFO,
ForgeUIPlugin.PLUGIN_ID,
info);
ForgeUIPlugin.getDefault().getLog().log(status);
}

}

0 comments on commit c07ce46

Please sign in to comment.