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 class App.Controller extends Spine.Controller
@include App.Log @include App.LogInclude
constructor: (params) -> constructor: (params) ->

View file

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

View file

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

View file

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

View file

@ -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 = {}

View file

@ -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 = {}

View file

@ -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 = {}

View file

@ -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 = {}

View file

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

View file

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