Skip to content

on ios "ns run" displays a lot of low level log messages #5626

New issue

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

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

Already on GitHub? Sign in to your account

Closed
3 tasks done
mrh1997 opened this issue Feb 7, 2022 · 6 comments · Fixed by #5679
Closed
3 tasks done

on ios "ns run" displays a lot of low level log messages #5626

mrh1997 opened this issue Feb 7, 2022 · 6 comments · Fixed by #5679

Comments

@mrh1997
Copy link

mrh1997 commented Feb 7, 2022

Issue Description

When running a app on ios I get a lot of messages as soon as touch events are seen (in contrary to android!). This makes debugging much more difficult, as my own debug log messages get lost within this amount of log irrelevant messages.

Reproduction

To repoduce:

1. start a app on ios
2. touch the phones surface to generate touch-messages

Relevant log output (if applicable)

Sending UIEvent type: 0; subtype: 0; to windows: 1
Sending UIEvent type: 0; subtype: 0; to window: <UIWindow: 0x108b0fd60>; contextId: 0x683206F2
Evaluating dispatch of UIEvent: 0x2807c0240; type: 0; subtype: 0; backing type: 11; shouldSend: 0; ignoreInteractionEvents: 0, systemGestureStateChange: 1
Evaluating dispatch of UIEvent: 0x2807c0240; type: 0; subtype: 0; backing type: 11; shouldSend: 1; ignoreInteractionEvents: 0, systemGestureStateChange: 0
Sending UIEvent type: 0; subtype: 0; to windows: 1
Sending UIEvent type: 0; subtype: 0; to window: <UIWindow: 0x108b0fd60>; contextId: 0x683206F2
Key window needs update: 0; currentKeyWindowScene: 0x0; evaluatedKeyWindowScene: 0x0; currentApplicationKeyWindow: 0x0; evaluatedApplicationKeyWindow: 0x0; reason: UIWindowScene: 0x108b125e0: Window requested to become key in scene: 0x108b0fd60
Evaluating dispatch of UIEvent: 0x2807c0240; type: 0; subtype: 0; backing type: 11; shouldSend: 1; ignoreInteractionEvents: 0, systemGestureStateChange: 0
Sending UIEvent type: 0; subtype: 0; to windows: 1
Sending UIEvent type: 0; subtype: 0; to window: <UIWindow: 0x108b0fd60>; contextId: 0x683206F2
Evaluating dispatch of UIEvent: 0x2807c0240; type: 0; subtype: 0; backing type: 11; shouldSend: 0; ignoreInteractionEvents: 0, systemGestureStateChange: 1
Evaluating dispatch of UIEvent: 0x2807c0240; type: 0; subtype: 0; backing type: 11; shouldSend: 1; ignoreInteractionEvents: 0, systemGestureStateChange: 0
Sending UIEvent type: 0; subtype: 0; to windows: 1

Environment

OS: macOS 11.4
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz
Shell: /bin/zsh
node: 14.15.0
npm: 6.14.8
nativescript: 8.1.5

# android
java: 1.8.0_275
ndk: Not Found
apis: 28
build_tools: 28.0.3
system_images: Not Found

# ios
xcode: 13.2.1/13C100
cocoapods: 1.10.0
python: 2.7.16
python3: 3.8.9
ruby: 2.6.3
platforms: 
  - DriverKit 21.2
  - iOS 15.2
  - macOS 12.1
  - tvOS 15.2
  - watchOS 8.3

Dependencies

"dependencies": {
  "@nativescript/core": "8.1.1",
  "@nativescript/theme": "~3.0.1",
  "nativescript-vue": "~2.9.0",
  "vue-class-decorator": "^7.6.3",
  "vue-property-decorator": "^9.1.2"
},
"devDependencies": {
  "@nativescript/ios": "8.1.0",
  "@nativescript/types-ios": "8.1.0",
  "@nativescript/android": "8.1.0",
  "@nativescript/types-android": "8.1.0",
  "@nativescript/types": "~8.1.1",
  "@nativescript/webpack": "~5.0.0",
  "@types/node": "~14.6.2",
  "nativescript-vue-template-compiler": "~2.9.0",
  "typescript": "~4.3.5",
  "vue": "~2.6.12"
}

Please accept these terms

@mrh1997 mrh1997 added the bug-pending-triage Reported bug, pending triage to confirm. label Feb 7, 2022
@rigor789 rigor789 transferred this issue from NativeScript/NativeScript Feb 11, 2022
@rigor789 rigor789 removed the bug-pending-triage Reported bug, pending triage to confirm. label Feb 11, 2022
@mrh1997
Copy link
Author

mrh1997 commented Feb 14, 2022

@rigor789 thanks for the tip.

Now that I know the correct repo I was able to identify the problamtic code:

The ios-log-filter.ts module displays all lines which are containing the text <notice>: (amongst others). See this regex.

But a lot of UIKitCore messages are containing these texts. Like:

Feb 14 16:26:56 iPhone-von-Robert NativeScriptSyncFolder(UIKitCore)[9891] <Notice>: Evaluating dispatch of UIEvent: 0x283654780; type: 0; subtype: 0; backing type: 11; shouldSend: 1; ignoreInteractionEvents: 0, systemGestureStateChange: 0
Feb 14 16:26:56 iPhone-von-Robert NativeScriptSyncFolder(UIKitCore)[9891] <Notice>: Sending UIEvent type: 0; subtype: 0; to windows: 1
Feb 14 16:26:56 iPhone-von-Robert NativeScriptSyncFolder(UIKitCore)[9891] <Notice>: Sending UIEvent type: 0; subtype: 0; to window: <UIWindow: 0x119411f80>; contextId: 0x3A76C967

Any Idea why the regex is so generic? My simple approch to solve the problem would be to simplify the regex and remove the <notice>: keyword from the filter. I would provide a corresponding pull request, but before doing so I would like to get your opinion about this solution.

@mrh1997
Copy link
Author

mrh1997 commented Feb 17, 2022

This fix works for me. But it fails with the unittests.

When I find some time I will look into this and create a merge request.

@rigor789
Copy link
Member

@mrh1997 nice - I think just adjusting the regex would be enough without the manual CONSOLE + further down.

I think just adding a non-capturing group at the end of the regex for CONSOLE should work:

`^.*(?:<Notice>:|<Error>|<Warning>:|${this.appOutputRegex.source}:)(?:\s+CONSOLE){1}`

But would need to test it to make sure...

@mrh1997
Copy link
Author

mrh1997 commented Feb 24, 2022

After some further tests with my fix proposal I realized that it won't work. Mainly it suffers from 2 problems:

  • multiline logmessages (like console.log("line1\nline2");) do not work. Only the first line will be displayed
  • exceptions will not be displayed at all

@kriefsacha
Copy link

Some news about this ?

@rigor789
Copy link
Member

Some news about this ?

No news at this point. When there are news the issue will be tagged/closed/commented-on etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants