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');
}
var cmsg = typeof(statusMsg) !== 'undefined' ? (" Msg: " + statusMsg) : "";
var fullmsg = "New state '" + state + "', was '" + oldstate + "'." + cmsg;
if (typeof(statusMsg) !== 'undefined') {
var cmsg = " Msg: " + statusMsg;
if (state === 'failed' || state === 'fatal') {
Util.Error(cmsg);
} else {
Util.Warn(cmsg);
}
}
var smsg = "New state '" + state + "', was '" + oldstate + "'.";
Util.Debug(smsg);
if (this._disconnTimer && state !== 'disconnect') {
Util.Debug("Clearing disconnect timer");