1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/docs/extensions/testing-and-publishing/testing.md
Roman ff6d3492de Rebasing branch before pushing to remote
PageRegistration / PageMenuRegistration fixes & more simplification (#1386)

* PageRegistration & PageMenuRegistration fixes & more simplification, fix #1383

Signed-off-by: Roman <ixrock@gmail.com>

* clean up test, deprecate page.routePath

Signed-off-by: Roman <ixrock@gmail.com>

* fix: proper `isActive` state matching for page-menu-target to page considering current document location

Signed-off-by: Roman <ixrock@gmail.com>

set "allowJs" to false in tsconfig (#1377)

- None of the .ts files include any of the .js files

- All .js files are either passed to electron-builder or used as config
  files for other programs.

Signed-off-by: Sebastian Malton <sebastian@malton.name>

cleanup main side of metrics route for readability (#988)

* cleanup main side of metrics route for readability

* split out ??= for headers

Signed-off-by: Sebastian Malton <sebastian@malton.name>

Release v4.0.0-beta.3 (#1395)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

Removed Advanced Topics bullet from Extension Development > Overview. Reworked content in Extension Development > Extension Capabilities, Extension Development > Testing and Publishing, and Contributing sections. Improved consistency throughout docs.

Signed-off-by: Paul Williams <pawilliams@mirantis.com>
2020-11-16 16:15:55 -08:00

1.2 KiB

Testing Extensions

Console.log

Extension developers might find console.log() useful for printing out information and errors from extensions. To use console.log(), note that Lens is based on Electron, and that Electron has two types of processes: Main and Renderer.

Renderer Process Logs

In the Renderer process, console.log() is printed in the Console in Developer Tools (View > Toggle Developer Tools).

Main Process Logs

Viewing the logs from the Main process is a little trickier, since they cannot be printed using Developer Tools.

macOS

On macOS, view the Main process logs by running Lens from the terminal:

/Applications/Lens.app/Contents/MacOS/Lens

You can also use Console.app to view the Main process logs.

Linux

On Linux, you can access the Main process logs using the Lens PID. First get the PID:

ps aux | grep Lens | grep -v grep

Then get the Main process logs using the PID:

tail -f /proc/[pid]/fd/1 # stdout (console.log)
tail -f /proc/[pid]/fd/2 # stdout (console.error)