[spartacus] use logger in place of console

RESOLVED FIXED in 2014-10-14

Status

Marketplace
Payments/Refunds
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: kumar, Assigned: kumar)

Tracking

Avenir
2014-10-14
x86
Mac OS X
Points:
---

Details

(Whiteboard: [qa-][repoman])

Lots of code does something like this:

var console = log('view', 'page');
...
console.log(...)

This is dangerous because if you forget to define a custom logger by way of a programming mistake, you'll get the default console. Let's change all instances to:

var logger = log('view', 'page');
...
logger.log(...)

This will ensure an error in the case of a programming mistake.
Assignee: nobody → kumar.mcmillan
Whiteboard: [qa-][repoman]
Part of this should be to verify that we don't lose reporting of line numbers. The current console code was tweaked to make sure you get the actual line that console.log() is called on rather than where the logging code is setup.
Not that this is likely to change - just worth mentioning as something to look out for.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2014-10-14
You need to log in before you can comment on or make changes to this bug.