unional / aurelia-logging-color

Colorful appender for aurelia-logging
MIT License
2 stars 3 forks source link

Color translation between Ansi and CSS #3

Open unional opened 7 years ago

unional commented 7 years ago

Logging tool such as redux-logger put CSS color strings directly in the message. For example: https://github.com/evgenyrodionov/redux-logger/blob/master/src/core.js#L97

We should add a way to read these strings and make the color work correctly in Node environment.

First, we should create tests to show how to hook up react-logger with aurelia-logging (using options: https://github.com/evgenyrodionov/redux-logger/blob/master/src/core.js#L97)

Then, we will figure out how the messages are passed to the logger so what we can detect and extract the CSS color styles.

Then, we create a translation layer converting CSS to ANSI (and vice versa).