Prefer putting nested structures on new lines

Format arguments to have nested structures start on a new line instead
of inline to make it easier to see where the structures starts and what
structure it is.
This commit is contained in:
Hornwitser committed 2023-07-26 14:27:49 +02:00
1 parent cb21a63ac2
commit 156d517976
7 files changed
+130 -77

No files matched your search

+21 -13
View File
@@ -36,11 +36,15 @@ class ControlConnector extends libLink.WebSocketClientConnector {
register() {
logger.verbose("Connector | registering control");
this.sendHandshake(new libData.MessageRegisterControl(new libData.RegisterControlData(
this._token,
"clusterioctl",
version,
)));
this.sendHandshake(
new libData.MessageRegisterControl(
new libData.RegisterControlData(
this._token,
"clusterioctl",
version,
)
)
);
}
}
@@ -87,9 +91,11 @@ class Control extends libLink.Link {
instanceIds = [],
maxLevel = null,
}) {
await this.send(new libData.LogSetSubscriptionsRequest(
all, controller, hostIds, instanceIds, maxLevel,
));
await this.send(
new libData.LogSetSubscriptionsRequest(
all, controller, hostIds, instanceIds, maxLevel,
)
);
}
async handleLogMessageEvent(event) {
@@ -166,11 +172,13 @@ async function startControl() {
let args = yargs.parse();
// Log stream for the ctl session.
logger.add(new ConsoleTransport({
errorLevels: Object.keys(levels),
level: args.logLevel,
format: new libLoggingUtils.TerminalFormat(),
}));
logger.add(
new ConsoleTransport({
errorLevels: Object.keys(levels),
level: args.logLevel,
format: new libLoggingUtils.TerminalFormat(),
})
);
libLoggingUtils.handleUnhandledErrors(logger);
logger.verbose(`Loading available plugins from ${args.pluginList}`);
+13 -9
View File
@@ -52,15 +52,19 @@ class HostConnector extends libLink.WebSocketClientConnector {
plugins[pluginInfo.name] = pluginInfo.version;
}
this.sendHandshake(new libData.MessageRegisterHost(new libData.RegisterHostData(
this.hostConfig.get("host.controller_token"),
"Clusterio Host",
version,
this.hostConfig.get("host.name"),
this.hostConfig.get("host.id"),
this.hostConfig.get("host.public_address"),
plugins,
)));
this.sendHandshake(
new libData.MessageRegisterHost(
new libData.RegisterHostData(
this.hostConfig.get("host.controller_token"),
"Clusterio Host",
version,
this.hostConfig.get("host.name"),
this.hostConfig.get("host.id"),
this.hostConfig.get("host.public_address"),
plugins,
)
)
);
}
}
+9 -5
View File
@@ -19,11 +19,15 @@ export class ControlConnector extends libLink.WebSocketClientConnector {
}
logger.verbose("Connector | registering control");
this.sendHandshake(new libData.MessageRegisterControl(new libData.RegisterControlData(
this.token,
"Clusterio Web UI",
packageJson.version,
)));
this.sendHandshake(
new libData.MessageRegisterControl(
new libData.RegisterControlData(
this.token,
"Clusterio Web UI",
packageJson.version,
)
)
);
}
}