Skip to content

Commit

Permalink
only log each missing sprite type once
Browse files Browse the repository at this point in the history
useful for debug, but too noisy for every instance
  • Loading branch information
bcamper committed Aug 3, 2016
1 parent 147b743 commit e681836
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/styles/points/points.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Object.assign(Points, {
reset () {
this.queues = {};
this.resetText();
this.texture_missing_sprites = {}; // track which missing sprites we've found (reduce dupe log messages)
},

// Override to queue features instead of processing immediately
Expand Down Expand Up @@ -136,7 +137,10 @@ Object.assign(Points, {
}
}
else {
log('debug', `Style: in style '${this.name}', could not find sprite '${sprite}' for texture '${this.texture}'`);
if (!this.texture_missing_sprites[sprite]) { // only log each missing sprite once
log('debug', `Style: in style '${this.name}', could not find sprite '${sprite}' for texture '${this.texture}'`);
this.texture_missing_sprites[sprite] = true;
}
return;
}
}
Expand Down

0 comments on commit e681836

Please sign in to comment.