From a48f2b40677c1e1d2c216748033b2232c4679703 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sat, 13 Aug 2022 11:51:11 -0600 Subject: [PATCH] Tidy up more log messages --- core/client.js | 2 +- core/client_term.js | 2 +- core/login_server_module.js | 9 +++++++-- core/message_area.js | 6 +++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/core/client.js b/core/client.js index d40c867d..9ac57f36 100644 --- a/core/client.js +++ b/core/client.js @@ -513,7 +513,7 @@ Client.prototype.startIdleMonitor = function () { idleLogoutSeconds > 0 && nowMs - this.lastActivityTime >= idleLogoutSeconds * 1000 ) { - this.emit('idle timeout'); + this.emit('idle timeout', idleLogoutSeconds); } }, 1000 * 60); }; diff --git a/core/client_term.js b/core/client_term.js index 8a546f92..938442fc 100644 --- a/core/client_term.js +++ b/core/client_term.js @@ -44,7 +44,7 @@ function ClientTerminal(output) { if (iconv.encodingExists(enc)) { Log.info( { encoding: enc, currentEncoding: outputEncoding }, - 'Setting client encoding.' + `Output encoding changed to ${enc}` ); outputEncoding = enc; } else { diff --git a/core/login_server_module.js b/core/login_server_module.js index 5f74801f..d356f40f 100644 --- a/core/login_server_module.js +++ b/core/login_server_module.js @@ -10,6 +10,7 @@ const UserProps = require('./user_property.js'); // deps const _ = require('lodash'); +const moment = require('moment'); module.exports = class LoginServerModule extends ServerModule { constructor() { @@ -87,8 +88,12 @@ module.exports = class LoginServerModule extends ServerModule { clientConns.removeClient(client); }); - client.on('idle timeout', () => { - client.log.info('User idle timeout expired'); + client.on('idle timeout', idleLogoutSeconds => { + client.log.info( + `Node ${client.node} idle timeout (${moment + .duration(idleLogoutSeconds, 'seconds') + .humanize()}) expired; Kicking` + ); client.menuStack.goto('idleLogoff', err => { if (err) { diff --git a/core/message_area.js b/core/message_area.js index 32825c71..c1a1c3a3 100644 --- a/core/message_area.js +++ b/core/message_area.js @@ -363,7 +363,7 @@ function changeMessageConference(client, confTag, cb) { if (!err) { client.log.info( { confTag: confTag, confName: conf.name, areaTag: areaInfo.areaTag }, - 'Current message conference changed' + `${client.node} changed message conference to ${areaInfo.areaTag}` ); } else { client.log.warn( @@ -412,9 +412,9 @@ function changeMessageAreaWithOptions(client, areaTag, options, cb) { ], function complete(err, area) { if (!err) { - client.log.info( + client.log.debug( { areaTag: areaTag, area: area }, - 'Current message area changed' + `Node ${client.node} changed message area to ${areaTag}` ); } else { client.log.warn(