Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logger: 'error', -> TypeError #7

Open
bebraw opened this issue Nov 30, 2015 · 2 comments
Open

logger: 'error', -> TypeError #7

bebraw opened this issue Nov 30, 2015 · 2 comments

Comments

@bebraw
Copy link

bebraw commented Nov 30, 2015

The docs could be a little clearer. Now they state that logger - allows to set log verbosity mode. Available values for log level are: level: 'verbose', 'debug', 'info', 'warn', 'error'; so I tried

var brokenLinksChecker = new BrokenLinksChecker({
  logger: 'error'
});

This yielded TypeError: Cannot assign to read only property 'useDate' of error.

By the looks of it, logger accepts a function. So something like this works:

var brokenLinksChecker = new BrokenLinksChecker({
  logger: console.error.bind(console),
});

Maybe you could rephrase the documentation a bit.

@tormozz48
Copy link
Member

Hello @bebraw

I'm very happy to receive this issue from you.

I agree that my documentation is far from clear, but I hope this example will help you more: https://github.com/bem-site/broken-links-checker/blob/master/examples/simple.js

level - is not value of logger property but only one of available fields.

var brokenLinksChecker = new BrokenLinksChecker({
  logger: {
     level: 'error'
  }
});

I hope my answer will be helpful for you

@bebraw
Copy link
Author

bebraw commented Nov 30, 2015

@tormozz48 Cool. That did the trick. Thanks. Here's my little script btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants