aleross / angular-segment-analytics

AngularJS module for easily adding Segment analytics to any app. https://segment.com
MIT License
43 stars 14 forks source link

Allow setting logger function #19

Open jrencz opened 8 years ago

jrencz commented 8 years ago

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:

aleross commented 8 years ago

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 commented 8 years ago

FYI: I'm working on a solution right now