Skip to content

Commit

Permalink
client: log when a stylesheet will be affected
Browse files Browse the repository at this point in the history
  • Loading branch information
shakyShane committed Dec 23, 2017
1 parent fb26e82 commit cb5b44c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions client/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/index.min.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions client/vendor/Reloader.ts
Expand Up @@ -183,20 +183,20 @@ export class Reloader {
});
}

this.logger.trace(`found ${links.length} LINKed stylesheets, ${imported.length} @imported stylesheets`);
this.logger.debug(`found ${links.length} LINKed stylesheets, ${imported.length} @imported stylesheets`);
const match = pickBestMatch(path, links.concat(imported), l => pathFromUrl(this.linkHref(l)));


if (match) {
if (match.object && match.object.rule) {
this.logger.trace(`reloading imported stylesheet: ${match.object.href}`);
this.logger.info(`reloading imported stylesheet: ${match.object.href}`);
this.reattachImportedRule(match.object);
} else {
this.logger.trace(`reloading stylesheet: ${this.linkHref(match.object)}`);
this.logger.info(`reloading stylesheet: ${this.linkHref(match.object)}`);
this.reattachStylesheetLink(match.object);
}
} else {
this.logger.trace(`reloading all stylesheets because path '${path}' did not match any specific one`);
this.logger.info(`reloading all stylesheets because path '${path}' did not match any specific one`);
links.forEach(link => this.reattachStylesheetLink(link));
}
return true;
Expand Down Expand Up @@ -242,7 +242,7 @@ export class Reloader {
// http://www.zachleat.com/web/load-css-dynamically/
// http://pieisgood.org/test/script-link-events/
clone.onload = () => {
this.logger.trace("the new stylesheet has finished loading");
this.logger.debug("the new stylesheet has finished loading");
this.knownToSupportCssOnLoad = true;
return executeCallback();
};
Expand All @@ -252,7 +252,7 @@ export class Reloader {
let poll;
(poll = () => {
if (clone.sheet) {
this.logger.trace("polling until the new CSS finishes loading...");
this.logger.debug("polling until the new CSS finishes loading...");
return executeCallback();
} else {
return this.Timer.start(50, poll);
Expand Down Expand Up @@ -376,7 +376,7 @@ export class Reloader {
if (url.indexOf(this.options.serverURL) < 0) {
const originalUrl = url;
url = this.options.serverURL + this.options.overrideURL + "?url=" + encodeURIComponent(url);
this.logger.trace(`overriding source URL ${originalUrl} with ${url}`);
this.logger.debug(`overriding source URL ${originalUrl} with ${url}`);
}
}

Expand Down

0 comments on commit cb5b44c

Please sign in to comment.