Skip to content

Commit

Permalink
Add ${pathnameAndSearch} info within _match() logging
Browse files Browse the repository at this point in the history
  • Loading branch information
nuragic committed Jun 7, 2019
1 parent 8379c51 commit 4bd2c80
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/workbox-routing/NavigationRoute.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,26 @@ class NavigationRoute extends Route {
for (const regExp of this._blacklist) {
if (regExp.test(pathnameAndSearch)) {
if (process.env.NODE_ENV !== 'production') {
logger.log(`The navigation route is not being used, since the ` +
`URL matches this blacklist pattern: ${regExp}`);
logger.log(`The navigation route ${pathnameAndSearch} is not ` +
`being used, since the URL matches this blacklist pattern: ` +
`${regExp}`);
}
return false;
}
}

if (this._whitelist.some((regExp) => regExp.test(pathnameAndSearch))) {
if (process.env.NODE_ENV !== 'production') {
logger.debug(`The navigation route is being used.`);
logger.debug(`The navigation route ${pathnameAndSearch} ` +
`is being used.`);
}
return true;
}

if (process.env.NODE_ENV !== 'production') {
logger.log(`The navigation route is not being used, since the URL ` +
`being navigated to doesn't match the whitelist.`);
logger.log(`The navigation route ${pathnameAndSearch} is not ` +
`being used, since the URL being navigated to doesn't ` +
`match the whitelist.`);
}
return false;
}
Expand Down

0 comments on commit 4bd2c80

Please sign in to comment.