Skip to content

Commit

Permalink
Merge pull request #9 from idolize/master
Browse files Browse the repository at this point in the history
feat: support custom loggers
  • Loading branch information
Eugene Rodionov committed Aug 21, 2015
2 parents 980633d + 53c4900 commit 91867aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ __createLogger(options?: Object)__
#### __level (String)__
Level of `console`. `warn`, `error`, `info` or [else](https://developer.mozilla.org/en/docs/Web/API/console).

#### __logger (Object)__
Implementation of the `console` API. Useful if you are using a custom, wrapped version of `console`.

#### __collapsed (Boolean)__
Is group collapsed?

Expand Down
3 changes: 2 additions & 1 deletion src/createLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

function createLogger(options = {}) {
return ({ getState }) => (next) => (action) => {
const { level, collapsed, predicate } = options;
const { level, collapsed, predicate, logger } = options;
const console = logger || console;

// exit if console undefined
if (typeof console === 'undefined') {
Expand Down

0 comments on commit 91867aa

Please sign in to comment.