Add verbose logging option

Add option to pass the --verbose flag to the Factorio server.
This commit is contained in:
Hornwitser committed 2020-11-09 15:57:46 +01:00
1 parent 67654fdf85
commit c8c65d2e92
4 files changed
+22

No files matched your search

+8
View File
@@ -280,6 +280,14 @@ here overrides the properties there.
Defaults to {"tags":["clusterio"],"auto_pause":false}.
### factorio.verbose_logging
Pass the `--verbose` flag to Factorio when starting the server. This
prints more messages to the log.
Defaults to false
### factorio.strip_paths
Strip down absolute paths in the server log going to files inside the
+6
View File
@@ -250,6 +250,12 @@ FactorioGroup.define({
"auto_pause": false,
},
});
FactorioGroup.define({
name: "verbose_logging",
description: "Enable verbose logging on the Factorio server",
type: "boolean",
initial_value: false,
});
FactorioGroup.define({
name: "strip_paths",
description: "Strip down instance paths in the log",
+7
View File
@@ -513,6 +513,8 @@ class FactorioServer extends events.EventEmitter {
* @param {number} options.gamePort - UDP port to host game on.
* @param {number} options.rconPort - TCP port to use for RCON.
* @param {string} options.rconPassword - Password use for RCON.
* @param {boolean} options.enableWhitelist - Turn on whitelisting.
* @param {boolean} options.verboseLogging - Enable verbose logging.
* @param {boolean} options.stripPaths - Strip paths in the console.
*/
constructor(factorioDir, writeDir, options) {
@@ -534,6 +536,8 @@ class FactorioServer extends events.EventEmitter {
this.rconPassword = options.rconPassword;
/** Enable player whitelist */
this.enableWhitelist = options.enableWhitelist;
/** Enable verbose logging */
this.verboseLogging = options.verboseLogging;
this._state = "new";
this._server = null;
this._rconClient = null;
@@ -810,6 +814,7 @@ class FactorioServer extends events.EventEmitter {
[
"--config", this.writePath("config.ini"),
"--create", this.writePath("saves", name),
...(this.verboseLogging ? ["--verbose"] : []),
],
{
detached: true,
@@ -852,6 +857,7 @@ class FactorioServer extends events.EventEmitter {
"--rcon-port", this.rconPort,
"--rcon-password", this.rconPassword,
...(this.enableWhitelist ? ["--use-server-whitelist"] : []),
...(this.verboseLogging ? ["--verbose"] : []),
],
{
detached: true,
@@ -886,6 +892,7 @@ class FactorioServer extends events.EventEmitter {
"--rcon-port", this.rconPort,
"--rcon-password", this.rconPassword,
...(this.enableWhitelist ? ["--use-server-whitelist"] : []),
...(this.verboseLogging ? ["--verbose"] : []),
],
{
detached: true,
+1
View File
@@ -135,6 +135,7 @@ class Instance extends libLink.Link{
rconPort: this.config.get("factorio.rcon_port"),
rconPassword: this.config.get("factorio.rcon_password"),
enableWhitelist: this.config.get("factorio.enable_whitelist"),
verboseLogging: this.config.get("factorio.verbose_logging"),
stripPaths: this.config.get("factorio.strip_paths"),
};