Skip to content

Allow setting logger function #19

Open
@jrencz

Description

@jrencz

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions