UiConfig plugin

This commit is contained in:
shortcutme 2018-07-10 03:30:47 +02:00
parent 5aab10fab2
commit 10bab2b6e4
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
17 changed files with 3240 additions and 0 deletions

View file

@ -0,0 +1,23 @@
class Class
trace: true
log: (args...) ->
return unless @trace
return if typeof console is 'undefined'
args.unshift("[#{@.constructor.name}]")
console.log(args...)
@
logStart: (name, args...) ->
return unless @trace
@logtimers or= {}
@logtimers[name] = +(new Date)
@log "#{name}", args..., "(started)" if args.length > 0
@
logEnd: (name, args...) ->
ms = +(new Date)-@logtimers[name]
@log "#{name}", args..., "(Done in #{ms}ms)"
@
window.Class = Class