terminal: colorize debug messages for in/out messages

This commit is contained in:
jean-emmanuel 2022-11-09 09:22:53 +01:00
parent aea55d45ca
commit c7ce398632
5 changed files with 19 additions and 5 deletions

View file

@ -109,7 +109,13 @@ class MidiConverter {
console.log(data)
}
} else if (name == 'debug') {
console.log('(DEBUG, MIDI) ' + data)
if (data.indexOf('in:') === 0) {
console.log('\x1b[36m(DEBUG, MIDI)', data, '\x1b[0m')
} else if (data.indexOf('out:') === 0) {
console.log('\x1b[35m(DEBUG, MIDI)', data, '\x1b[0m')
} else {
console.log('(DEBUG, MIDI) ' + data)
}
} else if (name == 'osc') {
instance.receiveOsc(data)
} else if (name == 'error') {