Improved logging.

This commit is contained in:
Martin Edenhofer 2015-12-01 19:44:31 +01:00
parent e751f975b3
commit 2d57994a16

View file

@ -21,7 +21,7 @@ do($ = window.jQuery, window) ->
buttonClass: 'open-zammad-chat' buttonClass: 'open-zammad-chat'
inactiveClass: 'is-inactive' inactiveClass: 'is-inactive'
title: '<strong>Chat</strong> with us!' title: '<strong>Chat</strong> with us!'
idleTimeout: 8 idleTimeout: 4
inactiveTimeout: 20 inactiveTimeout: 20
_messageCount: 0 _messageCount: 0
@ -613,28 +613,32 @@ do($ = window.jQuery, window) ->
inactiveTimeoutStart: => inactiveTimeoutStart: =>
@inactiveTimeoutStop() @inactiveTimeoutStop()
delay = => delay = =>
@log 'debug', "Inactive timeout of #{@options.inactiveTimeout} minutes, show timeout screen." @log 'debug', "Inactive timeout of #{@options.inactiveTimeout} minutes, show timeout screen.", new Date
@state = 'off' @state = 'off'
@setAgentOnlineState 'offline' @setAgentOnlineState 'offline'
@showTimeout() @showTimeout()
@wsClose() @wsClose()
@log 'debug', "Start inactive timeout in #{@options.inactiveTimeout} minutes", new Date
@inactiveTimeoutStopDelayId = setTimeout(delay, @options.inactiveTimeout * 1000 * 60) @inactiveTimeoutStopDelayId = setTimeout(delay, @options.inactiveTimeout * 1000 * 60)
inactiveTimeoutStop: => inactiveTimeoutStop: =>
return if !@inactiveTimeoutStopDelayId return if !@inactiveTimeoutStopDelayId
@log 'debug', "Stop inactive timeout of #{@options.inactiveTimeout} minutes at", new Date
clearTimeout(@inactiveTimeoutStopDelayId) clearTimeout(@inactiveTimeoutStopDelayId)
idleTimeoutStart: => idleTimeoutStart: =>
@idleTimeoutStop() @idleTimeoutStop()
delay = => delay = =>
@log 'debug', "Idle timeout of #{@options.idleTimeout} minutes, hide widget" @log 'debug', "Idle timeout of #{@options.idleTimeout} minutes, hide widget", new Date
@state = 'off' @state = 'off'
@hide() @hide()
@wsClose() @wsClose()
@log 'debug', "Start idle timeout in #{@options.idleTimeout} minutes", new Date
@idleTimeoutStopDelayId = setTimeout(delay, @options.idleTimeout * 1000 * 60) @idleTimeoutStopDelayId = setTimeout(delay, @options.idleTimeout * 1000 * 60)
idleTimeoutStop: => idleTimeoutStop: =>
return if !@idleTimeoutStopDelayId return if !@idleTimeoutStopDelayId
@log 'debug', "Stop idle timeout of #{@options.idleTimeout} minutes at", new Date
clearTimeout(@idleTimeoutStopDelayId) clearTimeout(@idleTimeoutStopDelayId)
window.ZammadChat = ZammadChat window.ZammadChat = ZammadChat