Improved namespace for App.Log, only provide @log in controllers.

This commit is contained in:
Martin Edenhofer 2013-06-22 17:53:42 +02:00
parent 96a2b971ff
commit 62b46e0052
10 changed files with 13 additions and 13 deletions

View file

@ -1,5 +1,5 @@
class App.Controller extends Spine.Controller
@include App.Log
@include App.LogInclude
constructor: (params) ->

View file

@ -1,12 +1,12 @@
class App.Log
_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

View file

@ -21,7 +21,7 @@ class App.Session
_instance.all()
class _sessionSingleton extends Spine.Module
@include App.Log
@include App.LogInclude
constructor: ->
@clear()

View file

@ -65,7 +65,7 @@ class App.Collection
_instance._observeStats()
class _collectionSingleton extends Spine.Module
@include App.Log
@include App.LogInclude
constructor: (@args) ->

View file

@ -27,7 +27,7 @@ class App.Delay
_instance._all()
class _delaySingleton extends Spine.Module
@include App.Log
@include App.LogInclude
constructor: ->
@levelStack = {}

View file

@ -30,7 +30,7 @@ class App.Event
_instance._allBindings()
class _eventSingleton extends Spine.Module
@include App.Log
@include App.LogInclude
constructor: ->
@eventCurrent = {}

View file

@ -40,7 +40,7 @@ class App.i18n
_instance.escape( args )
class _i18nSingleton extends Spine.Module
@include App.Log
@include App.LogInclude
constructor: ( locale ) ->
@map = {}

View file

@ -27,7 +27,7 @@ class App.Interval
_instance._all()
class _intervalSingleton extends Spine.Module
@include App.Log
@include App.LogInclude
constructor: ->
@levelStack = {}

View file

@ -60,7 +60,7 @@ class App.TaskManager
_instance.TaskbarId()
class _taskManagerSingleton extends App.Controller
@include App.Log
@include App.LogInclude
constructor: ->
super

View file

@ -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