Merge branch 'Logging' into 'master'

Rework logging

See merge request sheepitrenderfarm/client!266
This commit is contained in:
Sheepit Renderfarm
2023-11-09 13:25:21 +00:00
2 changed files with 5 additions and 6 deletions

View File

@@ -173,7 +173,6 @@ import okhttp3.HttpUrl;
//send "error" log containing config and fs health check //send "error" log containing config and fs health check
step = log.newCheckPoint(); step = log.newCheckPoint();
this.log.info("HWID: " + new HWIdentifier(log).getHardwareHash());
this.log.info("OS: " + OS.getOS().getVersion() + " " + System.getProperty("os.arch")); this.log.info("OS: " + OS.getOS().getVersion() + " " + System.getProperty("os.arch"));
this.log.info(configuration.toString()); this.log.info(configuration.toString());
for (String logline : configuration.filesystemHealthCheck()) { for (String logline : configuration.filesystemHealthCheck()) {

View File

@@ -40,18 +40,18 @@ public class HWIdentifier {
MessageDigest digest = MessageDigest.getInstance("md5"); MessageDigest digest = MessageDigest.getInstance("md5");
if ((hdSerial = getHarddriveSerial()).length() > 0) { if ((hdSerial = getHarddriveSerial()).length() > 0) {
hash = digest.digest(hdSerial.getBytes(StandardCharsets.UTF_8)); hash = digest.digest(hdSerial.getBytes(StandardCharsets.UTF_8));
log.debug("HWIdentifier::getHardwareHash found hdd hash"); log.debug("Hardware::loaded Hardware definitions ver 1.1");
} }
else if ((mac = getMAC()).length() > 0) { else if ((mac = getMAC()).length() > 0) {
hash = digest.digest(mac.getBytes(StandardCharsets.UTF_8)); hash = digest.digest(mac.getBytes(StandardCharsets.UTF_8));
log.debug("HWIdentifier::getHardwareHash found MAC hash"); log.debug("Hardware::loaded Hardware definitions ver 1.2");
} }
else { //Fallback: computing a hash out of homepath+jarFileLocation+cpuName else { //Fallback: computing a hash out of homepath+jarFileLocation+cpuName
log.debug("HWIdentifier::getHardwareHash using fallback method"); log.debug("Hardware::loaded Hardware definitions ver 1.3");
cpuName = getProcessorName(); cpuName = getProcessorName();
if (cpuName.isEmpty()) { if (cpuName.isEmpty()) {
log.error("HWIdentifier::getHardwareHash failed to retrieve CPU name. Can't create hardware hash"); log.error("Hardware::failed to load Hardware definitions");
throw new UnsupportedOperationException("Unable to create hash!"); throw new UnsupportedOperationException("Unable to load CPU information!");
} }
String homeDir = System.getProperty("user.home"); //get home path String homeDir = System.getProperty("user.home"); //get home path