use of com.biglybt.core.logging.LogRelation in project BiglyBT by BiglySoftware.
the class DownloadManagerMoveHandlerUtils method logError.
static void logError(String message, DownloadManager dm, Throwable e) {
LogRelation lr = (dm instanceof LogRelation) ? (LogRelation) dm : null;
if (lr == null) {
return;
}
if (!Logger.isEnabled()) {
return;
}
Logger.log(new LogEvent(lr, LogIDs.CORE, message, e));
}
use of com.biglybt.core.logging.LogRelation in project BiglyBT by BiglySoftware.
the class LoggerChannelImpl method log.
@Override
public void log(Object[] relatedTo, int log_type, String data) {
String listenerData;
if (relatedTo != null) {
StringBuilder text = new StringBuilder();
for (int i = 0; i < relatedTo.length; i++) {
Object obj = relatedTo[i];
if (obj == null)
continue;
if (i > 0)
text.append("; ");
if (obj instanceof LogRelation) {
text.append(((LogRelation) obj).getRelationText());
} else {
text.append("RelatedTo[").append(obj.toString()).append("]");
}
}
listenerData = text.toString() + "] " + data;
} else {
listenerData = data;
}
notifyListeners(log_type, addTimeStamp(listenerData));
if (isEnabled() && !no_output) {
data = "[" + name + "] " + data;
com.biglybt.core.logging.Logger.log(new LogEvent(relatedTo, LOGID, LogTypePluginToCore(log_type), data));
}
}
use of com.biglybt.core.logging.LogRelation in project BiglyBT by BiglySoftware.
the class DownloadManagerMoveHandlerUtils method logWarn.
static void logWarn(String message, DownloadManager dm) {
LogRelation lr = (dm instanceof LogRelation) ? (LogRelation) dm : null;
if (lr == null) {
return;
}
if (!Logger.isEnabled()) {
return;
}
Logger.log(new LogEvent(lr, LogIDs.CORE, LogEvent.LT_WARNING, message));
}
use of com.biglybt.core.logging.LogRelation in project BiglyBT by BiglySoftware.
the class DownloadManagerMoveHandlerUtils method logInfo.
// Helper log functions.
static void logInfo(String message, DownloadManager dm) {
LogRelation lr = (dm instanceof LogRelation) ? (LogRelation) dm : null;
if (lr == null) {
return;
}
if (!Logger.isEnabled()) {
return;
}
Logger.log(new LogEvent(lr, LogIDs.CORE, LogEvent.LT_INFORMATION, message));
}
Aggregations