Skip to content

Commit

Permalink
🔇 Make logging less noisy
Browse files Browse the repository at this point in the history
  • Loading branch information
leolabs committed Jan 16, 2025
1 parent dcb0c38 commit 05f4094
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ interface Config {
fineUpdates: boolean
}

const NOISY_ADDRESSES = new Set([
'/heartbeat',
'/global/humanPosition',
'/global/beatsPosition',
'/global/currentMeasure',
'/global/measureOrPosition',
'/setlist/remainingTimeInSong',
'/setlist/remainingTimeInSet',
'/timecode/tc',
])

class ModuleInstance extends InstanceBase<Config> {
config: Config = { serverHost: '127.0.0.1', fineUpdates: true }
oscServer: Server | null = null
Expand Down Expand Up @@ -200,7 +211,9 @@ class ModuleInstance extends InstanceBase<Config> {

initOscListeners(server: Server) {
server.on('message', ([address, ...args], info) => {
this.log('debug', 'OSC from ' + info.address + ': ' + JSON.stringify({ address, args }))
if (!NOISY_ADDRESSES.has(address)) {
this.log('debug', 'OSC from ' + info.address + ': ' + JSON.stringify({ address, args }))
}
})

//#region global
Expand Down Expand Up @@ -1658,10 +1671,6 @@ class ModuleInstance extends InstanceBase<Config> {
},
],
callback: ({ options }) => {
this.log(
'debug',
'Checking group solo: ' + JSON.stringify({ options, soloedGroups: [...this.soloedTrackGroups.keys()] }),
)
return this.soloedTrackGroups.has(String(options.group).toLowerCase())
},
},
Expand All @@ -1679,10 +1688,6 @@ class ModuleInstance extends InstanceBase<Config> {
},
],
callback: ({ options }) => {
this.log(
'debug',
'Checking group solo: ' + JSON.stringify({ options, mutedGroups: [...this.mutedTrackGroups.keys()] }),
)
return this.mutedTrackGroups.has(String(options.group).toLowerCase())
},
},
Expand Down

0 comments on commit 05f4094

Please sign in to comment.