Open chrylis opened 9 years ago
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 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!
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)
.