Clean up log output on state changes

This commit is contained in:
Samuel Mannehed 2016-09-02 12:03:16 +02:00
parent c00ee156b9
commit 52e9cc48b0
1 changed files with 10 additions and 6 deletions

View File

@ -463,13 +463,17 @@
Util.Error('Fatal error, cannot continue'); Util.Error('Fatal error, cannot continue');
} }
var cmsg = typeof(statusMsg) !== 'undefined' ? (" Msg: " + statusMsg) : ""; if (typeof(statusMsg) !== 'undefined') {
var fullmsg = "New state '" + state + "', was '" + oldstate + "'." + cmsg; var cmsg = " Msg: " + statusMsg;
if (state === 'failed' || state === 'fatal') { if (state === 'failed' || state === 'fatal') {
Util.Error(cmsg); Util.Error(cmsg);
} else { } else {
Util.Warn(cmsg); Util.Warn(cmsg);
} }
}
var smsg = "New state '" + state + "', was '" + oldstate + "'.";
Util.Debug(smsg);
if (this._disconnTimer && state !== 'disconnect') { if (this._disconnTimer && state !== 'disconnect') {
Util.Debug("Clearing disconnect timer"); Util.Debug("Clearing disconnect timer");