Fix: logger is null
This commit is contained in:
committed by
Laurent Clouet
parent
a4678348ec
commit
2d35ad7ef8
@@ -22,6 +22,7 @@ package com.sheepit.client.main;
|
||||
import com.sheepit.client.config.Configuration;
|
||||
import com.sheepit.client.hardware.gpu.GPU;
|
||||
import com.sheepit.client.hardware.gpu.GPUDevice;
|
||||
import com.sheepit.client.logger.Log;
|
||||
import org.kohsuke.args4j.CmdLineException;
|
||||
import org.kohsuke.args4j.CmdLineParser;
|
||||
import org.kohsuke.args4j.OptionDef;
|
||||
@@ -37,6 +38,12 @@ public class ListGpuParameterHandler<T> extends OptionHandler<T> {
|
||||
}
|
||||
|
||||
@Override public int parseArguments(Parameters params) throws CmdLineException {
|
||||
// set a temporary log instance, in case there is a log call between here and config/setting merge
|
||||
Configuration config = new Configuration(null, "", "");
|
||||
config.setDebugLevel(true);
|
||||
config.setPrintLog(true);
|
||||
Log.setInstance(config);
|
||||
|
||||
List<GPUDevice> gpus = GPU.listDevices(new Configuration(null, null, null));
|
||||
if (gpus != null) {
|
||||
for (GPUDevice gpu : gpus) {
|
||||
|
||||
Reference in New Issue
Block a user