Skip to content

Commit

Permalink
Update for logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
sugi committed Nov 20, 2014
1 parent d5371fd commit 0567b31
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions jquery.gcal_flow.coffee
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
$ = jQuery

if window? and window._gCalFlow_debug? and console?
log = console
log.debug ?= log.log
else
log = {}
log.error = log.warn = log.log = log.info = log.debug = ->
log = {}
log.error = log.warn = log.log = log.info = log.debug = ->

if window? and console?
unless window._gCalFlow_quiet
for prio in ['error', 'warn', 'info']
log[prio] = if console[prio]? then console[prio] else console.log
if window._gCalFlow_debug
log.debug = if console.debug? then console.debug else console.log

pad_zero = (num, size = 2) ->
if 10 * (size-1) <= num then return num
Expand Down

0 comments on commit 0567b31

Please sign in to comment.