Skip to content
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

Suppress ANSI when output redirected #435

Open
chrylis opened this issue Feb 16, 2015 · 6 comments
Open

Suppress ANSI when output redirected #435

chrylis opened this issue Feb 16, 2015 · 6 comments
Labels

Comments

@chrylis
Copy link

chrylis commented Feb 16, 2015

Mimosa has nice colored output which is helpful for identifying warnings during development, but it outputs ANSI escape codes unconditionally, which leaves CI logs and similar output captures with odd stray characters. It would be helpful to act like GNU ls and grep and suppress color output if !isatty(stdout).

@dbashford
Copy link
Owner

I can take a look at something like that. There was a thread about something like this on the Google group and the poster had a great solution. Great use of profiles.

https://groups.google.com/forum/m/#!topic/mimosajs/zEO86-2a7kg

@chrylis
Copy link
Author

chrylis commented Feb 16, 2015

This is the sort of thing that's fairly universal (redirected output should just be the plain text), and I really do suggest having it as built-in behavior. (I have absolutely no idea how to do that in Node, though.)

@dbashford
Copy link
Owner

Well, with 2 or 3 minutes of work the profile solution would solve your problem. But yeah, worthwhile feature. Not sure how to figure out if something isn't going to stdout. Will poke around.

@dbashford
Copy link
Owner

@chrylis
Copy link
Author

chrylis commented Feb 16, 2015

Is the message-formatting code (specifically that applies the coloring) centralized, or are there multiple components that each handle formatting for different message types?

@dbashford
Copy link
Owner

Centralized. https://github.com/dbashford/logmimosa

logmimosa is attached to the mimosaConfig object passed to the modules: https://github.com/dbashford/mimosa-ember-module-import/blob/master/src/index.js#L64

Module can choose to import logmimosa directly, but I've not seen one that does.

So, once the feature is added and mimosa is upgraded to contain it (logmimosa is a dependency of mimosa) then all the modules will take advantage.

At this point, except for critical bugs, I'm postponing feature stuff that effects core until I've wrapped up testing/javascript translation of mimosa core. This feature is definitely key enough to make the 3.0 release. Once I've knocked out testing it'll be in the group of things that I take care of before releasing.

Thanks for the suggestion!

@dbashford dbashford added the 3.0 label Feb 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants