NativeScript / ios-jsc

NativeScript for iOS using JavaScriptCore

Home Page:http://docs.nativescript.org/runtimes/ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unify the format between console.trace and console.log messages

Fatme opened this issue · comments

commented

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.0.0
  • Cross-platform modules: 5.0.0
  • iOS Runtime: 5.0.0
  • Android Runtime (if applicable):
  • Plugin(s):

Describe the bug
console.trace("myTraceMessage") is printed in the format below:

file:///app/main-page.js:35:18: CONSOLE TRACE myTraceMessage

console.log("myLogMessage") is printed in the format below:

CONSOLE LOG file:///app/main-page.js:36:16: myLogMessage

To Reproduce

console.trace("myTraceMessage");
console.log("myLogMessage");

Expected behavior
The messages should be printed in the same format.

Additional context
The problem is in this code as we have two different methods for log and trace messages.
On the other side ConsoleClient::printConsoleMessageWithArguments method has an issue that json objects are printed as [Object object]. So we need to construct the message first and after that print it.

As the {N} Preview app relies on the format of the messages, we need to change this code as well in case we change the format of console.log.