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

Allow setting logger function #19

Open
jrencz opened this issue Sep 13, 2016 · 2 comments
Open

Allow setting logger function #19

jrencz opened this issue Sep 13, 2016 · 2 comments

Comments

@jrencz
Copy link

jrencz commented Sep 13, 2016

I have 2 use cases where this might be useful:

  1. when one wants to check WHERE segment.track was used one should use console.trace instead of console.log. Right now in debug mode all logs originate in the same line in angular-segment-analytics source which is not useful for finding a call with incorrect arguments)

  2. when one wanted to use different logger than console (for example $log)

Suggested API:

  • if setDebug() is called with a boolean then console.log is used, if function is passed this function is used, or
  • setLogger(someFunction)
@aleross
Copy link
Owner

aleross commented Sep 17, 2016

This makes sense @jrencz! If you can whip up a PR with the API you prefer and some test coverage I'd be happy to review and merge.

@jrencz
Copy link
Author

jrencz commented Sep 26, 2016

FYI: I'm working on a solution right now

jrencz added a commit to functionite/angular-segment-analytics that referenced this issue Sep 26, 2016
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