use of com.biglybt.core.util.AEDiagnosticsLogger in project BiglyBT by BiglySoftware.
the class ClientMessageContextImpl method debug.
@Override
public void debug(String message) {
AEDiagnosticsLogger diag_logger = AEDiagnostics.getLogger("v3.CMsgr");
diag_logger.log("[" + id + "] " + message);
if (ConstantsVuze.DIAG_TO_STDOUT) {
System.out.println("[" + id + "] " + message);
}
}
use of com.biglybt.core.util.AEDiagnosticsLogger in project BiglyBT by BiglySoftware.
the class ClientMessageContextImpl method debug.
@Override
public void debug(String message, Throwable t) {
AEDiagnosticsLogger diag_logger = AEDiagnostics.getLogger("v3.CMsgr");
diag_logger.log("[" + id + "] " + message);
diag_logger.log(t);
if (ConstantsVuze.DIAG_TO_STDOUT) {
System.err.println("[" + id + "] " + message);
t.printStackTrace();
}
}
use of com.biglybt.core.util.AEDiagnosticsLogger in project BiglyBT by BiglySoftware.
the class ConfigListener method handleMessage.
// @see com.biglybt.ui.swt.browser.msg.AbstractMessageListener#handleMessage(com.biglybt.ui.swt.browser.msg.BrowserMessage)
@Override
public void handleMessage(BrowserMessage message) {
try {
String opid = message.getOperationId();
if (OP_GET_VERSION.equals(opid)) {
Map decodedMap = message.getDecodedMap();
String callback = MapUtils.getMapString(decodedMap, "callback", null);
if (callback != null) {
context.executeInBrowser(callback + "('" + Constants.AZUREUS_VERSION + "')");
} else {
message.debug("bad or no callback param");
}
} else if (OP_NEW_INSTALL.equals(opid)) {
Map decodedMap = message.getDecodedMap();
String callback = MapUtils.getMapString(decodedMap, "callback", null);
if (callback != null) {
context.executeInBrowser(callback + "(" + COConfigurationManager.isNewInstall() + ")");
} else {
message.debug("bad or no callback param");
}
} else if (OP_CHECK_FOR_UPDATES.equals(opid)) {
checkForUpdates();
} else if (OP_GET_MAGNET_PORT.equals(opid)) {
Map decodedMap = message.getDecodedMap();
String callback = MapUtils.getMapString(decodedMap, "callback", null);
if (callback != null) {
context.executeInBrowser(callback + "('" + MagnetURIHandler.getSingleton().getPort() + "')");
} else {
message.debug("bad or no callback param");
}
} else if (OP_LOG_DIAGS.equals(opid)) {
logDiagnostics();
} else if (OP_LOG.equals(opid)) {
Map decodedMap = message.getDecodedMap();
String loggerName = MapUtils.getMapString(decodedMap, "log-name", "browser");
String text = MapUtils.getMapString(decodedMap, "text", "");
AEDiagnosticsLogger diag_logger = AEDiagnostics.getLogger(loggerName);
diag_logger.log(text);
if (ConstantsVuze.DIAG_TO_STDOUT) {
System.out.println(Thread.currentThread().getName() + "|" + System.currentTimeMillis() + "] " + text);
}
}
} catch (Throwable t) {
message.debug("handle Config message", t);
}
}
use of com.biglybt.core.util.AEDiagnosticsLogger in project BiglyBT by BiglySoftware.
the class BrowserMessage method debug.
public void debug(String message, Throwable t) {
try {
AEDiagnosticsLogger diag_logger = AEDiagnostics.getLogger("v3.CMsgr");
String out = "[" + getListenerId() + ":" + getOperationId() + "] " + message;
diag_logger.log(out);
if (t != null) {
diag_logger.log(t);
}
if (ConstantsVuze.DIAG_TO_STDOUT) {
System.out.println(out);
if (t != null) {
t.printStackTrace();
}
}
} catch (Throwable t2) {
Debug.out(t2);
}
}
use of com.biglybt.core.util.AEDiagnosticsLogger in project BiglyBT by BiglySoftware.
the class ConfigSectionTransferAutoSpeedBeta method configSectionCreate.
@Override
public Composite configSectionCreate(final Composite parent) {
GridData gridData;
Composite cSection = new Composite(parent, SWT.NULL);
gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL);
cSection.setLayoutData(gridData);
GridLayout subPanel = new GridLayout();
subPanel.numColumns = 3;
cSection.setLayout(subPanel);
// add a comment to the debug log.
// /////////////////////////////////
// Comment group
// /////////////////////////////////
Group commentGroup = new Group(cSection, SWT.NULL);
Messages.setLanguageText(commentGroup, "ConfigTransferAutoSpeed.add.comment.to.log.group");
GridLayout commentLayout = new GridLayout();
commentLayout.numColumns = 3;
commentGroup.setLayout(commentLayout);
gridData = new GridData(GridData.FILL_HORIZONTAL);
commentGroup.setLayoutData(gridData);
// Label
Label commentLabel = new Label(commentGroup, SWT.NULL);
Messages.setLanguageText(commentLabel, "ConfigTransferAutoSpeed.add.comment.to.log");
gridData = new GridData();
gridData.horizontalSpan = 1;
commentLabel.setLayoutData(gridData);
// Text-Box
final Text commentBox = new Text(commentGroup, SWT.BORDER);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
commentBox.setText("");
commentBox.setLayoutData(gridData);
// button
Button commentButton = new Button(commentGroup, SWT.PUSH);
// Messages.
gridData = new GridData();
gridData.horizontalSpan = 1;
commentButton.setLayoutData(gridData);
Messages.setLanguageText(commentButton, "ConfigTransferAutoSpeed.log.button");
commentButton.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
// Add a file to the log.
AEDiagnosticsLogger dLog = AEDiagnostics.getLogger("AutoSpeed");
String comment = commentBox.getText();
if (comment != null) {
if (comment.length() > 0) {
dLog.log("user-comment:" + comment);
commentBox.setText("");
}
}
}
});
// spacer
Label commentSpacer = new Label(cSection, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 3;
commentSpacer.setLayoutData(gridData);
// /////////////////////////
// Upload Capacity used settings.
// /////////////////////////
Group uploadCapGroup = new Group(cSection, SWT.NULL);
Messages.setLanguageText(uploadCapGroup, "ConfigTransferAutoSpeed.upload.capacity.usage");
GridLayout uCapLayout = new GridLayout();
uCapLayout.numColumns = 2;
uploadCapGroup.setLayout(uCapLayout);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 3;
uploadCapGroup.setLayoutData(gridData);
// Label column
Label upCapModeLbl = new Label(uploadCapGroup, SWT.NULL);
gridData = new GridData();
upCapModeLbl.setLayoutData(gridData);
Messages.setLanguageText(upCapModeLbl, "ConfigTransferAutoSpeed.mode");
Label ucSetLbl = new Label(uploadCapGroup, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 2;
Messages.setLanguageText(ucSetLbl, "ConfigTransferAutoSpeed.capacity.used");
Label dlModeLbl = new Label(uploadCapGroup, SWT.NULL);
Messages.setLanguageText(dlModeLbl, "ConfigTransferAutoSpeed.while.downloading");
// add a drop down.
String[] downloadModeNames = { " 80%", " 70%", " 60%", " 50%" };
int[] downloadModeValues = { 80, 70, 60, 50 };
new IntListParameter(uploadCapGroup, SpeedLimitMonitor.USED_UPLOAD_CAPACITY_DOWNLOAD_MODE, downloadModeNames, downloadModeValues);
// spacer
Label cSpacer = new Label(cSection, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 4;
cSpacer.setLayoutData(gridData);
// ////////////////////////
// DHT Ping Group
// ////////////////////////
Group dhtGroup = new Group(cSection, SWT.NULL);
Messages.setLanguageText(dhtGroup, "ConfigTransferAutoSpeed.data.update.frequency");
dhtGroup.setLayout(subPanel);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 3;
dhtGroup.setLayoutData(gridData);
// how much data to accumulate before making an adjustment.
Label iCount = new Label(dhtGroup, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
iCount.setLayoutData(gridData);
// iCount.setText("Adjustment interval: ");
Messages.setLanguageText(iCount, "ConfigTransferAutoSpeed.adjustment.interval");
IntParameter adjustmentInterval = new IntParameter(dhtGroup, SpeedManagerAlgorithmProviderV2.SETTING_INTERVALS_BETWEEN_ADJUST);
gridData = new GridData();
adjustmentInterval.setLayoutData(gridData);
// spacer
cSpacer = new Label(cSection, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 1;
cSpacer.setLayoutData(gridData);
// how much data to accumulate before making an adjustment.
Label skip = new Label(dhtGroup, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 2;
gridData.horizontalAlignment = GridData.BEGINNING;
skip.setLayoutData(gridData);
// skip.setText("Skip after adjustment: ");
Messages.setLanguageText(skip, "ConfigTransferAutoSpeed.skip.after.adjust");
BooleanParameter skipAfterAdjustment = new BooleanParameter(dhtGroup, SpeedManagerAlgorithmProviderV2.SETTING_WAIT_AFTER_ADJUST);
gridData = new GridData();
skipAfterAdjustment.setLayoutData(gridData);
// spacer
cSpacer = new Label(cSection, SWT.NULL);
gridData = new GridData();
gridData.horizontalSpan = 3;
cSpacer.setLayoutData(gridData);
return cSection;
}
Aggregations