terminal: colorize debug messages for in/out messages
This commit is contained in:
parent
aea55d45ca
commit
c7ce398632
5 changed files with 19 additions and 5 deletions
|
|
@ -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') {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class OscServer {
|
|||
|
||||
}
|
||||
|
||||
if (debug) console.log('(DEBUG, OSC) Out: ',{address:data.address, args: data.args}, 'To: ' + data.host + ':' + data.port)
|
||||
if (debug) console.log('\x1b[35m(DEBUG, OSC) Out: ',{address:data.address, args: data.args}, 'To: ' + data.host + ':' + data.port, '\x1b[0m')
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ class OscServer {
|
|||
|
||||
ipc.send('receiveOsc', data, clientId)
|
||||
|
||||
if (debug) console.log('(DEBUG, OSC) In: ', {address:data.address, args: data.args}, 'From: ' + data.host + ':' + data.port)
|
||||
if (debug) console.log('\x1b[36m(DEBUG, OSC) In: ', {address:data.address, args: data.args}, 'From: ' + data.host + ':' + data.port, '\x1b[0m')
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue