Skip to content

Commit

Permalink
Removed debugging loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
salvatore-coppola committed Nov 8, 2024
1 parent 0b6944b commit 9b4f106
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

import org.eclipse.kura.web.Console;
Expand Down Expand Up @@ -98,8 +97,6 @@ public class AssetConfigurationUi extends AbstractServicesUi implements HasConfi

private static final String COLUMN_VISIBILITY_SETTINGS_KEY = "org.eclipse.kura.settings.column.asset.";

private static final Logger logger = Logger.getLogger(AssetConfigurationUi.class.getSimpleName());

private static final List<String> defaultHiddenColumns = //
Arrays.asList(//
AssetConstants.VALUE_UNIT.value(), //
Expand Down Expand Up @@ -323,8 +320,6 @@ public void setPageStart(int index) {
this.btnManageHiddenColumn.setText(MSGS.columnVisibilityModalButton(//
String.valueOf(totalEnabledColumns(this.columnNameVisibilityMap)),
String.valueOf(this.columnNameVisibilityMap.size())));

logger.info("created AssetConfigurationUi for: " + this.model.getAssetPid());
}

private void fillColumnVisibilityCheckBox() {
Expand Down Expand Up @@ -394,7 +389,6 @@ private void resetDefaultColumnVisibilityMap() {

private void populateColumnVisibilityMap() {
this.model.getChannelDescriptor().getParameters().forEach(param -> {
AssetConfigurationUi.logger.info("Id: " + param.getId() + ", Name: " + param.getName());
if (!param.getId().equals(AssetConstants.ENABLED.value())
&& !param.getId().equals(AssetConstants.NAME.value())) {
boolean visible = !defaultHiddenColumns.contains(param.getId());
Expand Down Expand Up @@ -450,7 +444,6 @@ private void initTable() {
}

private void addColumn(final GwtConfigParameter param) {
logger.info("Adding column for: " + param.getId());
AssetConfigurationUi.this.channelTable.addColumn(
getColumnFromParam(param, param.getId().equals(AssetConstants.NAME.value())), buildHeader(param));
}
Expand Down Expand Up @@ -535,7 +528,6 @@ private Column<ChannelModel, String> getInputCellColumn(final GwtConfigParameter
final String paramId = channelModel.getChannelName() + '#' + param.getId();
Integer paramIndex = AssetConfigurationUi.this.model.getParameterIndex(param.getId());
channelModel.setValue(paramIndex, value);
AssetConfigurationUi.logger.info("Setting value for " + paramId + " to " + value);
if (!channelModel.isValid(paramIndex)) {
AssetConfigurationUi.this.invalidParameters.add(paramId);
} else {
Expand Down Expand Up @@ -583,15 +575,12 @@ public String getValue(final ChannelModel channelModel) {
}
};

logger.info("param: " + param.getId() + "has reaonly: " + isReadOnly);

if (!isReadOnly) {
result.setFieldUpdater((index, channelModel, label) -> {
String paramId = param.getId();
AssetConfigurationUi.this.setDirty(true);
String newValue = labelsToValues.get(label);
Integer paramIndex = AssetConfigurationUi.this.model.getParameterIndex(paramId);
logger.info("changing param: " + paramId + " to: " + newValue + " with index" + paramIndex);
String oldValue = channelModel.getValue(paramIndex);
channelModel.setValue(paramIndex, newValue);
if ((param.getId().equals(AssetConstants.VALUE_TYPE.value())
Expand All @@ -603,10 +592,8 @@ public String getValue(final ChannelModel channelModel) {
String paramIdentifier = channelModel.getChannelName() + '#' + paramEntry.getKey();
Integer parameterIndex = paramEntry.getValue();
if (!channelModel.isValid(parameterIndex)) {
logger.info("Invalid parameter: " + paramIdentifier);
AssetConfigurationUi.this.invalidParameters.add(paramIdentifier);
} else {
logger.info("Valid parameter: " + paramIdentifier);
AssetConfigurationUi.this.invalidParameters.remove(paramIdentifier);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.logging.Logger;
import java.util.stream.Collectors;

import org.eclipse.kura.web.client.ui.drivers.assets.LegacyChannelModel.LegacyChannelModelBuilder;
Expand All @@ -33,8 +32,6 @@

public class AssetModelImpl implements AssetModel {

private static final Logger logger = Logger.getLogger(AssetModelImpl.class.getSimpleName());

public static final LabelComparator<LegacyChannelModel> CHANNEL_LABEL_COMPARATOR = new LabelComparator<>();

private final GwtConfigComponent assetConfiguration;
Expand Down Expand Up @@ -146,8 +143,6 @@ private void loadChannelModels() {

this.channelModels.clear();
this.channelModels.addAll(sortedLegacyChannelModels);

logger.info("ChannelModels for " + getAssetPid() + ":" + " " + this.channelModels.toString());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;

import org.eclipse.kura.web.client.util.ValidationUtil;
import org.eclipse.kura.web.shared.AssetConstants;
Expand All @@ -27,8 +26,6 @@

public class LegacyChannelModel implements AssetModel.ChannelModel {

private static final Logger logger = Logger.getLogger(LegacyChannelModel.class.getSimpleName());

private final String channelName;
private final GwtConfigParameter[] parameters;

Expand All @@ -38,14 +35,10 @@ public LegacyChannelModel(String channelName, GwtConfigParameter[] parameters) {
this.channelName = channelName;
this.parameters = parameters;

logger.info("Parameters for channelName " + channelName + ": " + this.parameters);

// calculate the subtype for scale and offset parameters based on the scaleoffset.type and value type
// properties.
detectSubtype();

logger.info("Subtype: " + this.subtype);

setScaleOffsetSubtype();
}

Expand All @@ -55,19 +48,14 @@ private void setScaleOffsetSubtype() {
|| param.getId().equals(getId(AssetConstants.VALUE_OFFSET))) {

param.setSubtype(this.subtype);

logger.info("Subtype for " + param.getId() + ": " + param.getSubtype());
}
}
}

private void updateScaleOffsetSubtypeForParameters() {
for (GwtConfigParameter param : this.parameters) {
if (param.getSubtype() != null && param.getSubtype() != this.subtype) {

param.setSubtype(this.subtype);

logger.info("Subtype for " + param.getId() + ": " + param.getSubtype() + " updated");
}
}
}
Expand All @@ -91,8 +79,6 @@ private void detectSubtype() {
}

if (scaleOffsetType != null && valueType != null) {
logger.info("ScaleOffsetType: " + scaleOffsetType + ", ValueType: " + valueType);

subType = scaleOffsetType == ScaleOffsetType.DEFINED_BY_VALUE_TYPE
? GwtConfigParameterType.valueOf(valueType.name())
: GwtConfigParameterType.valueOf(scaleOffsetType.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.logging.Logger;

import org.eclipse.kura.web.client.messages.Messages;
import org.eclipse.kura.web.client.ui.drivers.assets.AssetConfigurationUi;
import org.eclipse.kura.web.shared.model.GwtConfigComponent;
import org.eclipse.kura.web.shared.model.GwtConfigParameter;
import org.eclipse.kura.web.shared.model.GwtConfigParameter.GwtConfigParameterType;
Expand All @@ -27,8 +26,6 @@

public final class ValidationUtil {

private static final Logger logger = Logger.getLogger(AssetConfigurationUi.class.getSimpleName());

private static final String CONFIG_MAX_VALUE = "configMaxValue";
private static final String CONFIG_MIN_VALUE = "configMinValue";
private static final String INVALID_VALUE = "invalidValue";
Expand All @@ -49,8 +46,6 @@ public static void validateParameters(GwtConfigComponent componentConfig, Valida
// Validates all the entered values
public static void validateParameter(GwtConfigParameter param, String value, ValidationErrorConsumer consumer) {

logger.info("Validating parameter: " + param.toString());

if (value == null || value.trim().isEmpty()) {
if (!param.isRequired()) {
return;
Expand Down

0 comments on commit 9b4f106

Please sign in to comment.