Skip to content

fix: device logs parsing #5253

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Feb 19, 2020
Merged

fix: device logs parsing #5253

merged 3 commits into from
Feb 19, 2020

Conversation

rosen-vladimirov
Copy link
Contributor

fix: file paths shown for device logs should be clickable

Currently CLI tries to persist the formating of logs as close as possible to the real logs coming from device.
The logs from the applications contain file:///<filePath>. CLI replaces the <filePath> with the real local file path. However, due to the file:/// prefix, the link is not clickable. For example, in case you use VSCode's terminal, you should be able to use Ctrl + Click on the link and this will lead you to the exact line where the stack trace points to.
To resolve this issue, replace the file:/// with just file: .

fix: paths to platform specific files are not correct in logs

When CLI parses the device logs, it tries to replace the file location with the real file path location. However, this does not work for platform specific files (in non-Angular projects) as we are using a virtual file system in webpack, which "lies" the file button.js exists, while in fact the file is button.<platform>.js. So in the source maps, the location of the file is button.js.
To resolve this, check if there's a platform specific file and use it instead. Cache the original file location, so we'll not execute multiple file operations for the same file.

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes issues #5252 and #5236

Currently CLI tries to persist the formating of logs as close as possible to the real logs coming from device.
The logs from the applications contain `file:///<filePath>`. CLI replaces the `<filePath>` with the real local file path. However, due to the `file:///` prefix, the link is not clickable. For example, in case you use VSCode's terminal, you should be able to use Ctrl + Click on the link and this will lead you to the exact line where the stack trace points to.
To resolve this issue, replace the `file:///` with just `file: `.
When CLI parses the device logs, it tries to replace the file location with the real file path location. However, this does not work for platform specific files (in non-Angular projects) as we are using a virtual file system in webpack, which "lies" the file `button.js` exists, while in fact the file is `button.<platform>.js`. So in the source maps, the location of the file is `button.js`.
To resolve this, check if there's a platform specific file and use it instead. Cache the original file location, so we'll not execute multiple file operations for the same file.
@rosen-vladimirov rosen-vladimirov added this to the 6.4.1 milestone Feb 19, 2020
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 19, 2020
@cla-bot cla-bot bot added the cla: yes label Feb 19, 2020
@rosen-vladimirov
Copy link
Contributor Author

test cli-smoke cli-run

@rosen-vladimirov rosen-vladimirov merged commit 168c2ae into release Feb 19, 2020
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/logs-fixes branch February 19, 2020 13:59
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants