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
|
class App.Controller extends Spine.Controller
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: (params) ->
|
constructor: (params) ->
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
class App.Log
|
|
||||||
_instance = undefined
|
_instance = undefined
|
||||||
|
class App.LogInclude
|
||||||
@log: ( level, args... ) ->
|
@log: ( level, args... ) ->
|
||||||
if _instance == undefined
|
if _instance == undefined
|
||||||
_instance ?= new _Singleton
|
_instance ?= new _Singleton
|
||||||
module = @constructor.name
|
module = @constructor.name
|
||||||
_instance.log( module, level, args )
|
_instance.log( module, level, args )
|
||||||
|
|
||||||
|
class App.Log
|
||||||
@debug: ( module, args... ) ->
|
@debug: ( module, args... ) ->
|
||||||
if _instance == undefined
|
if _instance == undefined
|
||||||
_instance ?= new _Singleton
|
_instance ?= new _Singleton
|
||||||
|
|
|
@ -21,7 +21,7 @@ class App.Session
|
||||||
_instance.all()
|
_instance.all()
|
||||||
|
|
||||||
class _sessionSingleton extends Spine.Module
|
class _sessionSingleton extends Spine.Module
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
@clear()
|
@clear()
|
||||||
|
|
|
@ -65,7 +65,7 @@ class App.Collection
|
||||||
_instance._observeStats()
|
_instance._observeStats()
|
||||||
|
|
||||||
class _collectionSingleton extends Spine.Module
|
class _collectionSingleton extends Spine.Module
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: (@args) ->
|
constructor: (@args) ->
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ class App.Delay
|
||||||
_instance._all()
|
_instance._all()
|
||||||
|
|
||||||
class _delaySingleton extends Spine.Module
|
class _delaySingleton extends Spine.Module
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
@levelStack = {}
|
@levelStack = {}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class App.Event
|
||||||
_instance._allBindings()
|
_instance._allBindings()
|
||||||
|
|
||||||
class _eventSingleton extends Spine.Module
|
class _eventSingleton extends Spine.Module
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
@eventCurrent = {}
|
@eventCurrent = {}
|
||||||
|
|
|
@ -40,7 +40,7 @@ class App.i18n
|
||||||
_instance.escape( args )
|
_instance.escape( args )
|
||||||
|
|
||||||
class _i18nSingleton extends Spine.Module
|
class _i18nSingleton extends Spine.Module
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: ( locale ) ->
|
constructor: ( locale ) ->
|
||||||
@map = {}
|
@map = {}
|
||||||
|
|
|
@ -27,7 +27,7 @@ class App.Interval
|
||||||
_instance._all()
|
_instance._all()
|
||||||
|
|
||||||
class _intervalSingleton extends Spine.Module
|
class _intervalSingleton extends Spine.Module
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
@levelStack = {}
|
@levelStack = {}
|
||||||
|
|
|
@ -60,7 +60,7 @@ class App.TaskManager
|
||||||
_instance.TaskbarId()
|
_instance.TaskbarId()
|
||||||
|
|
||||||
class _taskManagerSingleton extends App.Controller
|
class _taskManagerSingleton extends App.Controller
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
constructor: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
|
@ -32,7 +32,7 @@ class App.WebSocket
|
||||||
|
|
||||||
# The actual Singleton class
|
# The actual Singleton class
|
||||||
class _webSocketSingleton extends App.Controller
|
class _webSocketSingleton extends App.Controller
|
||||||
@include App.Log
|
@include App.LogInclude
|
||||||
|
|
||||||
queue: []
|
queue: []
|
||||||
supported: true
|
supported: true
|
||||||
|
@ -179,7 +179,7 @@ class _webSocketSingleton extends App.Controller
|
||||||
@connectionWasEstablished = true
|
@connectionWasEstablished = true
|
||||||
|
|
||||||
# close error message show up (because try so connect again) if exists
|
# 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
|
if @error
|
||||||
@error.modalHide()
|
@error.modalHide()
|
||||||
@error = false
|
@error = false
|
||||||
|
|
Loading…
Reference in a new issue