fix: missing logs when __enableVerboseLogging
is called
#4334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you call
__enableVerboseLogging()
in your application, runtimes print more messages, which could be used for identifying issues.In the official version, when you enable this logging in your app, you see some messages in CLI's output of
tns run
command.However, this has been working by mistake for Android as CLI does not expect to show these messages, as their category is
TNS.Native
orTNS.Java
. As CLI does not match these categories, it check if the message contains any of the supported categories. Some of the messages haveJS
in the strings, for example:This led to CLI showing the messages.
After fixing CLI to show only the supported categories (in a previous commit), CLI no longer shows these messages. To show them, add
TNS.Native
andTNS.Java
categories to supported ones.Of course, this leads to another issue - during start of application (init of Android Runtime), the verbose logging is enabled by default and now we always show messages:
As these messages are printed on every Android Runtime Initialization, we do not want to flood the output in CLI. So, we'll introduce a new category in the Android Runtime Logging -
TNS.Runtime
. We need it to print the mentioned messages, as there's no way to enable the verboseLogging before initializing the runtime.CLI will filter these messages and will not show them.
PR Checklist
Related to PR: NativeScript/android#1265