So verwenden Sie Farben zum Drucken
Code
Sie müssen nur die verfügbaren Schlüsselwörter am Anfang des Druckbefehls verwenden, um die Farbe zu ändern.
Bekannt
Schlüsselwort/Farbe
- INFO – blau
 - WARNUNG – gelb
 - ACHTUNG – gelb
 - FEHLER – rot
 
Hier ist ein einfacher Code, um die verfügbaren Farben auszugeben und im Terminal anzuzeigen:
/** @param {NS} ns **/
export async function main(ns) {
 ns.tprintf('INFO---available log colors:')
 ns.tprintf('INFOthey only need to be at the start')
 ns.tprintf(`otherwise INFO or others won't work`)
 ns.tprintf('WARN this is a warning')
 ns.tprintf('WARNING this is also warning')
 ns.tprintf('ERROR this is an error')
}  Dies wird im Terminal ausgegeben: