If you are debugging properties (for example, data binding), read the properties guide and use the observers field. Here is an example:
Polymer({ is: 'portfolios-foobar', properties: { portfolios: { type: Array, value: [], notify: true, reflectToAttribute: true, observer: 'logChange' } }, logChange: function(newValue, oldValue) { console.log('Changed! To:', newValue); }, addFolio: function(folio) { this.push('portfolios', folio); }, observers: [ 'logFor(portfolios)', 'hackyObserver1(portfolios.*)', 'hackyObserver2(portfolios.splices)' ], logFor: function(newValue, oldValue) { console.log('LogFor! To:', newValue); }, hackyObserver1: function(changes) { console.log('One!', changes); }, hackyObserver2: function(changeRecord) { console.log('Two! Splices!', changeRecord); } });
Also after binding Polymer you can do:
Polymer.log = console.log.bind(console);
Log names will be logged here.
source share