Skip to content

[Request] Apply Font Colors to Console Output to Improve Differentiation #719

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

Open
jbristowe opened this issue Jul 30, 2015 · 6 comments
Open

Comments

@jbristowe
Copy link
Contributor

Currently, the CLI provides a great deal of information when running applications against a device like an iPhone. At times, it can be difficult to pick out console.log() statements from your application because the font color is the same for all output that's emitted to the console.

Request: Apply specific font colors to different message types (i.e. console.log() vs info vs warnings vs errors vs device logs) that are output to the console.

@emiloberg
Copy link

For Android which is really really chatty:

I really recommend trying to integrate PID Cat. PID Cat is a fork of logcat-color which is »A colorful and highly configurable alternative to the standard "adb logcat" command from the Android SDK». The difference is that PID Cat must be started with a package namespace as an argument. E.g:

pidcat org.nativescript.helloworld

...and only shows logs from that package. As we all know, the Android log is really noisy and we really just want the logs of the current app.

PID Cat/logcat is also configurable so that you can say that the "tag" (the type of message... ish) JS should be the color X. You can also configure it to e.g. not show the tag NSLayout (which quickly can flood the log).

See screenshot of my (default configured) PID Cat. Hi there being my console.log.

skarmavbild 2015-09-24 kl 09 44 01

@webleaf
Copy link

webleaf commented Jan 31, 2019

Is it done or not? How to use it?

@rosen-vladimirov
Copy link
Contributor

Hey @webleaf ,
In 2016 we have applied some colorization of the CLI's output - warnings are printed in yellow, errors are in red, information messages use the default terminal colors, command help is colorized, etc. It looks like this triggered closing of this feature request. However, the particular use case described in this issue is still valid and not implemented, so I'm reopening this issue.
Thanks for getting our attention back to this feature.

@farfromrefug
Copy link
Contributor

farfromrefug commented Feb 25, 2019

@rosen-vladimirov stumble upon that issue looking for a solution to mine + questions:

  • first where is the colored applied to the ios logs? I have an issue where in VSCode console the ios logs do not show color but the actual ansi codes. Might be related to tty Can you point to where it is done so that i can create an issue in the right project?
  • I am trying to apply custom colors for some console.log directly in my app. However they seem to be overriden by the cli. Always green. Anyway around this?

EDIT: for the second part, i actually found out it is an issue with nativescript-vue nativescript-vue/nativescript-vue#441

@7ammer
Copy link

7ammer commented Aug 27, 2019

This would be super helpful!

Being able to use console.log(util.inspect({test:'foo'}, { colors: true, showHidden: true, depth: 4 })) would be super too!

@webleaf
Copy link

webleaf commented Sep 2, 2019

chalk could be used

@rosen-vladimirov rosen-vladimirov added this to the 6.2.0 milestone Sep 5, 2019
@rosen-vladimirov rosen-vladimirov removed their assignment Sep 5, 2019
@KristianDD KristianDD added the ux label Sep 11, 2019
@KristianDD KristianDD self-assigned this Oct 28, 2019
@Fatme Fatme modified the milestones: 6.2.0, 6.4.0 Nov 1, 2019
@rosen-vladimirov rosen-vladimirov removed this from the 6.4.0 milestone Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants