versatica/JsSIP — pull request #170 by jlaine (2013-10-24 07:47:53+00:00)
Title: Add a JsSIP.Logger class to handle logging

JsSIP has extensive logging, which is of great help when debugging problems. The logging output is formatted in a way which reflects the classes, which is also very handy for debugging. However, it does fall short in one respect: there is no way to capture this logging, nor to change its format, for instance to output it in HTML.

This pull request adds a JsSIP.Logger class which centralises all logging calls, which gives you a single point to override if you which to way logging works. It mimicks the "console" API, with the 3 methods used by JsSIP:

- log
- warn
- error

Passing LOG_PREFIX is no longer required as each module creates a Logger with the proper prefix. The output remains the same as it was, except for a couple of cases where LOG_PREFIX was missing => it's now totally consistent.