 
 # For the Browser Process
 class DebugBrowser extends DebugBase
-  _log: (msg = '', obj = null) ->
-    txt = "[DEBUG] #{msg}".cyan
-    if obj? then console.log txt, obj else console.log txt
+  constructor: ->
+    @_log = console.log.bind console, '[DEBUG] %s'.cyan
 
   init: ->
     return Debug.wrap('Already initialized') if @isInitialized()

        toString:
          value: -> "[#{tag}: #{if @isEnabled() then 'enabled' else 'disabled'}]"

  _log: doNothing
  Object.defineProperties @prototype,
    log:
      get: -> if @isEnabled() then @_log else doNothing
    extra:
      value: new ExtraDebugOptions
      enumerable: true

  initialized = false
  isInitialized: ->


# For the Renderer Processes
class DebugRenderer extends DebugBase
  style = 'background: linear-gradient(30deg, cyan, white 3ex)'
  constructor: ->
    @_log = console.debug.bind console, '%c%s', style

  init: ->
    return Debug.wrap('Already initialized') if @isInitialized()
