Skip to content

web-ext run: only show the last reload time #617

@kumar303

Description

@kumar303

Is this a bug or feature request?

feature

What is the current behavior?

In web-ext run, you see a log message each time the extension is automatically reloaded.

What is the expected or desired behavior?

You should only see the last time the extension was reloaded. It's not important to clutter the console repeatedly with each reload.

For example, this is what it currently looks like when you make a lot of changes to an extension:

$ web-ext run -s example-extension/
Running web extension from /Users/kumar/dev/web-ext-workshop/example-extension
Running Firefox with profile at /var/folders/h7/rttdqkks7fl_txp9_rr4j4840000gn/T/de60a72b-20aa-4218-8cc5-75981d9c677f
Use --verbose or open Tools > Web Developer > Browser Console to see logging
Installed /Users/kumar/dev/web-ext-workshop/example-extension as a temporary add-on
The extension will reload if any source file changes
14:17:21 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:17:30 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:19:02 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:19:45 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:20:37 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:20:52 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:24:15 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:24:18 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:24:26 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:25:01 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:25:45 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon
14:25:54 GMT+0100 (BST): Reloaded extension: 1757806243269f9c45e4996230fed971c42e689f@temporary-addon

This is what it should look like:

$ web-ext run -s example-extension/
Running web extension from /Users/kumar/dev/web-ext-workshop/example-extension
Running Firefox with profile at /var/folders/h7/rttdqkks7fl_txp9_rr4j4840000gn/T/de60a72b-20aa-4218-8cc5-75981d9c677f
Use --verbose or open Tools > Web Developer > Browser Console to see logging
Installed /Users/kumar/dev/web-ext-workshop/example-extension as a temporary add-on
The extension will reload if any source file changes
Last extension reload: 14:25:54 GMT+0100 (BST)

(This new output also removes the extension ID because that's not important.)

Some tips:

  • This will need to use shell escaping to rewrite the current log line (example)
  • If the last line does not start with 'Last extension reload' then it should not be rewritten
  • In verbose mode, it should continue to just log a new line with the time and extension ID.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions