Skip to content

Commit

Permalink
feat: Use minilog from window if available
Browse files Browse the repository at this point in the history
  • Loading branch information
ptbrowne authored and kosssi committed May 9, 2019
1 parent f1aba47 commit 1cc390a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/cozy-realtime/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import MicroEE from 'microee'
import Socket from './Socket'
import minilog from 'minilog'
import minilog_ from 'minilog'

const minilog = (typeof window !== undefined && window.minilog) || minilog_
const logger = minilog('cozy-realtime')
minilog.suggest.deny('cozy-realtime', 'info')

Expand Down Expand Up @@ -219,6 +220,7 @@ class CozyRealtime {
}

for (const key of keys) {
logger.debug('Emitting', key, doc)
this.emit(key, doc)
}
}
Expand Down

0 comments on commit 1cc390a

Please sign in to comment.