Improved namespace for App.Log, only provide @log in controllers.
This commit is contained in:
parent
96a2b971ff
commit
62b46e0052
10 changed files with 13 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
class App.Controller extends Spine.Controller
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: (params) ->
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
class App.Log
|
||||
_instance = undefined
|
||||
|
||||
_instance = undefined
|
||||
class App.LogInclude
|
||||
@log: ( level, args... ) ->
|
||||
if _instance == undefined
|
||||
_instance ?= new _Singleton
|
||||
module = @constructor.name
|
||||
_instance.log( module, level, args )
|
||||
|
||||
class App.Log
|
||||
@debug: ( module, args... ) ->
|
||||
if _instance == undefined
|
||||
_instance ?= new _Singleton
|
||||
|
|
|
@ -21,7 +21,7 @@ class App.Session
|
|||
_instance.all()
|
||||
|
||||
class _sessionSingleton extends Spine.Module
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: ->
|
||||
@clear()
|
||||
|
|
|
@ -65,7 +65,7 @@ class App.Collection
|
|||
_instance._observeStats()
|
||||
|
||||
class _collectionSingleton extends Spine.Module
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: (@args) ->
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class App.Delay
|
|||
_instance._all()
|
||||
|
||||
class _delaySingleton extends Spine.Module
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: ->
|
||||
@levelStack = {}
|
||||
|
|
|
@ -30,7 +30,7 @@ class App.Event
|
|||
_instance._allBindings()
|
||||
|
||||
class _eventSingleton extends Spine.Module
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: ->
|
||||
@eventCurrent = {}
|
||||
|
|
|
@ -40,7 +40,7 @@ class App.i18n
|
|||
_instance.escape( args )
|
||||
|
||||
class _i18nSingleton extends Spine.Module
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: ( locale ) ->
|
||||
@map = {}
|
||||
|
|
|
@ -27,7 +27,7 @@ class App.Interval
|
|||
_instance._all()
|
||||
|
||||
class _intervalSingleton extends Spine.Module
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: ->
|
||||
@levelStack = {}
|
||||
|
|
|
@ -60,7 +60,7 @@ class App.TaskManager
|
|||
_instance.TaskbarId()
|
||||
|
||||
class _taskManagerSingleton extends App.Controller
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
constructor: ->
|
||||
super
|
||||
|
|
|
@ -32,7 +32,7 @@ class App.WebSocket
|
|||
|
||||
# The actual Singleton class
|
||||
class _webSocketSingleton extends App.Controller
|
||||
@include App.Log
|
||||
@include App.LogInclude
|
||||
|
||||
queue: []
|
||||
supported: true
|
||||
|
@ -179,7 +179,7 @@ class _webSocketSingleton extends App.Controller
|
|||
@connectionWasEstablished = true
|
||||
|
||||
# close error message show up (because try so connect again) if exists
|
||||
@clearDelay('websocket-no-connection-try-reconnect-message')
|
||||
@clearDelay('websocket-no-connection-try-reconnect-message', 'ws')
|
||||
if @error
|
||||
@error.modalHide()
|
||||
@error = false
|
||||
|
|
Loading…
Reference in a new issue