[Pharo-project] Colored Stdout/Stderr logging with headless images
This is so cool and beautiful, this new addition where errors with headless images are printed directly to stout or stderr with coloring ! I just saw it the first time today. Really helpful. Thanks a lot Camillo ! Sven -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
actually its a bit of a hack :D (well the implementation not) but the problem is, that we should properly detect if the terminal supports colors or not ;) otherwise you might get some ugly escape sequences :D best cami On 2012-03-06, at 11:44, Sven Van Caekenberghe wrote:
This is so cool and beautiful, this new addition where errors with headless images are printed directly to stout or stderr with coloring !
I just saw it the first time today. Really helpful. Thanks a lot Camillo !
<Screen Shot 2012-03-06 at 11.39.04.png> Sven
-- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
On 06 Mar 2012, at 13:18, Camillo Bruni wrote:
actually its a bit of a hack :D (well the implementation not)
but the problem is, that we should properly detect if the terminal supports colors or not ;) otherwise you might get some ugly escape sequences :D
Do you know the tput tool? I use it in my makefiles like this: START_BOLD=$(shell tput bold) STOP_BOLD=$(shell tput sgr0) It gives you the supported escape sequence for a give style based on a database of terminals and your current environment. Best regards Stefan -- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
On 6 March 2012 13:46, Stefan Marr <smalltalk@stefan-marr.de> wrote:
On 06 Mar 2012, at 13:18, Camillo Bruni wrote:
actually its a bit of a hack :D (well the implementation not)
but the problem is, that we should properly detect if the terminal supports colors or not ;) otherwise you might get some ugly escape sequences :D
Do you know the tput tool?
I use it in my makefiles like this: Â Â Â Â START_BOLD=$(shell tput bold) Â Â Â Â STOP_BOLD=$(shell tput sgr0)
It gives you the supported escape sequence for a give style based on a database of terminals and your current environment.
yeah, but that means that VM (or some plugin/prim) is needed to detect that it outputs to terminal, and not redirected to file or pipes output to another process.
Best regards Stefan
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: Â +32 2 629 3525
-- Best regards, Igor Stasenko.
I have a complete implementation of it ready together with a pure-st readline lib ;) So when the time is ready I will integrate it :P On 2012-03-06, at 13:59, Igor Stasenko wrote:
On 6 March 2012 13:46, Stefan Marr <smalltalk@stefan-marr.de> wrote:
On 06 Mar 2012, at 13:18, Camillo Bruni wrote:
actually its a bit of a hack :D (well the implementation not)
but the problem is, that we should properly detect if the terminal supports colors or not ;) otherwise you might get some ugly escape sequences :D
Do you know the tput tool?
I use it in my makefiles like this: START_BOLD=$(shell tput bold) STOP_BOLD=$(shell tput sgr0)
It gives you the supported escape sequence for a give style based on a database of terminals and your current environment.
yeah, but that means that VM (or some plugin/prim) is needed to detect that it outputs to terminal, and not redirected to file or pipes output to another process.
Best regards Stefan
-- Stefan Marr Software Languages Lab Vrije Universiteit Brussel Pleinlaan 2 / B-1050 Brussels / Belgium http://soft.vub.ac.be/~smarr Phone: +32 2 629 2974 Fax: +32 2 629 3525
-- Best regards, Igor Stasenko.
On 06 Mar 2012, at 14:12, Camillo Bruni wrote:
I have a complete implementation of it ready together with a pure-st readline lib ;) So when the time is ready I will integrate it :P
Readline ! Is there anything these young guys can't do with Pharo Smalltalk ? Incredible⦠Keep up the good work. Sven
participants (4)
-
Camillo Bruni -
Igor Stasenko -
Stefan Marr -
Sven Van Caekenberghe