Skip to content

Add console warnings if a shortcut has been skipped.#122

Merged
andreban merged 4 commits intoGoogleChromeLabs:masterfrom
rayankans:master
Mar 11, 2020
Merged

Add console warnings if a shortcut has been skipped.#122
andreban merged 4 commits intoGoogleChromeLabs:masterfrom
rayankans:master

Conversation

@rayankans
Copy link
Contributor

Resolves #116

@rayankans
Copy link
Contributor Author

@andreban Do you mind taking a look

@andreban
Copy link
Member

Have you considered using Log.ts to output the warnings? There's a Log.warn() method that will format it as a warning (yellow) and with a tag.

@rayankans
Copy link
Contributor Author

Changed this to use Log.ts

generatorApp: string;
webManifestUrl?: URL;

private static log: Log = new Log('twa-manifest');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I've been passing a log object in the constructor, but initialising with a default value. This helps with tests so those don't pollute the console. But I'm ok to keep like this too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's being used from within a static function though. I could make it a module-level constant but that won't help with the pollution issue.

@andreban andreban merged commit a62bec9 into GoogleChromeLabs:master Mar 11, 2020
@andreban andreban added the enhancement New feature or request label Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shortcut items with no icon URL are ignored

2 participants