Tidy up more log messages

This commit is contained in:
Bryan Ashby 2022-08-13 11:51:11 -06:00
parent 21d0ad9e59
commit a48f2b4067
No known key found for this signature in database
GPG Key ID: C2C1B501E4EFD994
4 changed files with 12 additions and 7 deletions

View File

@ -513,7 +513,7 @@ Client.prototype.startIdleMonitor = function () {
idleLogoutSeconds > 0 && idleLogoutSeconds > 0 &&
nowMs - this.lastActivityTime >= idleLogoutSeconds * 1000 nowMs - this.lastActivityTime >= idleLogoutSeconds * 1000
) { ) {
this.emit('idle timeout'); this.emit('idle timeout', idleLogoutSeconds);
} }
}, 1000 * 60); }, 1000 * 60);
}; };

View File

@ -44,7 +44,7 @@ function ClientTerminal(output) {
if (iconv.encodingExists(enc)) { if (iconv.encodingExists(enc)) {
Log.info( Log.info(
{ encoding: enc, currentEncoding: outputEncoding }, { encoding: enc, currentEncoding: outputEncoding },
'Setting client encoding.' `Output encoding changed to ${enc}`
); );
outputEncoding = enc; outputEncoding = enc;
} else { } else {

View File

@ -10,6 +10,7 @@ const UserProps = require('./user_property.js');
// deps // deps
const _ = require('lodash'); const _ = require('lodash');
const moment = require('moment');
module.exports = class LoginServerModule extends ServerModule { module.exports = class LoginServerModule extends ServerModule {
constructor() { constructor() {
@ -87,8 +88,12 @@ module.exports = class LoginServerModule extends ServerModule {
clientConns.removeClient(client); clientConns.removeClient(client);
}); });
client.on('idle timeout', () => { client.on('idle timeout', idleLogoutSeconds => {
client.log.info('User idle timeout expired'); client.log.info(
`Node ${client.node} idle timeout (${moment
.duration(idleLogoutSeconds, 'seconds')
.humanize()}) expired; Kicking`
);
client.menuStack.goto('idleLogoff', err => { client.menuStack.goto('idleLogoff', err => {
if (err) { if (err) {

View File

@ -363,7 +363,7 @@ function changeMessageConference(client, confTag, cb) {
if (!err) { if (!err) {
client.log.info( client.log.info(
{ confTag: confTag, confName: conf.name, areaTag: areaInfo.areaTag }, { confTag: confTag, confName: conf.name, areaTag: areaInfo.areaTag },
'Current message conference changed' `${client.node} changed message conference to ${areaInfo.areaTag}`
); );
} else { } else {
client.log.warn( client.log.warn(
@ -412,9 +412,9 @@ function changeMessageAreaWithOptions(client, areaTag, options, cb) {
], ],
function complete(err, area) { function complete(err, area) {
if (!err) { if (!err) {
client.log.info( client.log.debug(
{ areaTag: areaTag, area: area }, { areaTag: areaTag, area: area },
'Current message area changed' `Node ${client.node} changed message area to ${areaTag}`
); );
} else { } else {
client.log.warn( client.log.warn(