-
Notifications
You must be signed in to change notification settings - Fork 34
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
Comments
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 |
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.) |
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. |
Going to just leave this here for later: http://stackoverflow.com/questions/7080458/test-whether-the-actual-output-is-a-terminal-or-not-in-node-js |
Is the message-formatting code (specifically that applies the coloring) centralized, or are there multiple components that each handle formatting for different message types? |
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 Thanks for the suggestion! |
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
andgrep
and suppress color output if!isatty(stdout)
.The text was updated successfully, but these errors were encountered: