#ANSI Sequences / Log Levels

1 messages · Page 1 of 1 (latest)

muted ferry
#

Heya, i want to print messages to log either using ANSI color support alas:

console.log('\u001b[32 [PIX 19_KUBEJS_RECIPE_MASTER] Tagging complete!')

Where \u001b[32 would be the escape sequence.
^ This one does not work.

Which is supported in windows and unix consoles or using the [WARN] and [ERROR] Log levels from Log4J

Is there a way to do this using the console.log function?

last badgerBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

muted ferry
#

Log4J Also has a Module for converting output stream to ANSI escape sequences so i hoped it would be supported somehow

#

I also tried
console.info('\u00A76' + '[PIX-19_KUBEJS_RECIPE_MASTER] Initializing..')

#

This one doesn't get malformed in the console so it seems to be read but it doesn't change the color

#

OMG i am so dumb

steel slate
#

🤔 Why do you need to use ANSI and Log Level?

muted ferry
#

Colored console output

#

but i just found out how to use log level

#

one can just console.warn or console.error

steel slate
#

The log of KubeJS is essentially a plain text file

#

However, it is indeed impossible to use Log Level at present.

muted ferry
#

It is it works

#

console.error('\u00A76' + '[PIX-19_KUBEJS_RECIPE_MASTER] Initializing..')