COMMUNITY

Console.hx – library for coloring terminal output

Hey all :),

I tend to do a fair bit of scripting with haxe and I find handy to be able to color the output to highlight the most important information

I wanted to share a little library I use to make my terminal output pretty in case it’s helpful to others! Console.hx (GitHub)

Console.hx lets you use HTML-like tags to set color and formatting, here’s some examples

Console.log('<cyan>Hello</>, <b>World!</>');

53

Console.error('<b>HTTP Error</b>: <white>404</> <yellow>File not found</>');

57

Console.examine() is a macro that prints the variable names along side their values, for all those printf debuggers out there this will save you some time :slight_smile:

var x = 31.1;
var y = 65.3;
var name = 'Douglas Adams';
Console.examine(x, y, name);

21

It will also work in browser consoles too

9 Likes

Thanks, George! So easy to use!

1 Like