mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 08:42:58 +00:00
redirect output and error from process builder to files within the plugin directory
This commit is contained in:
1 file changed
+6
@@ -59,6 +59,8 @@ public class ShellService implements ClientApp {
|
||||
private final ProcessBuilder _pb;
|
||||
private final I2PAppContext _context;
|
||||
private final ClientAppManager _cmgr;
|
||||
private final File _errorLog;
|
||||
private final File _outputLog;
|
||||
|
||||
private ClientAppState _state = ClientAppState.UNINITIALIZED;
|
||||
|
||||
@@ -84,6 +86,10 @@ public class ShellService implements ClientApp {
|
||||
_pb = new ProcessBuilder(process);
|
||||
|
||||
File pluginDir = new File(_context.getConfigDir(), PLUGIN_DIR + '/' + this.getName());
|
||||
_errorLog = new File(pluginDir, "error.log");
|
||||
_outputLog = new File(pluginDir, "output.log");
|
||||
_pb.redirectOutput(_outputLog);
|
||||
_pb.redirectError(_errorLog);
|
||||
_pb.directory(pluginDir);
|
||||
changeState(ClientAppState.INITIALIZED, "ShellService: " + getName() + " set up and initialized");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user