Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jack: add timestamps to debug logs #1285

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theGreatWhiteShark
Copy link
Contributor

Having timestamps showing at which point in time Muse4 did encounter which JACK position and triggered which API call is of massive help when correlating the logs with behavior/output of other applications.

The resulting format will look like this

[10:20:00.064] timebase_callback is new_pos:1 nframes:512 frame:0 tickPos:0 cpos:0
[10:20:01.062] JackAudioDevice::setMaster val:1 unconditional:0
[10:20:01.067] timebase_callback() state:0
[10:20:01.067] timebase_callback BBT:
 bar:1 beat:1 tick:0
 bar_start_tick:0.000000 beats_per_bar:4.000000 beat_type:4.000000 ticks_per_beat:384.000000 beats_per_minute:120.000000
[10:20:01.067] pos_to_jack_position new: bar:1 beat:1 tick:0
 bar_start_tick:0.000000 beats_per_bar:4.000000 beat_type:4.000000 ticks_per_beat:384.000000 beats_per_minute:120.000000

Personally, I am more a fan of wrapping the log code in a function call than a multiline macro, but I did not wanted refactor your code (without asking first).

Having timestamps showing at which point in time `Muse4` did encounter which JACK position and triggered which API call is of massive help when correlating the logs with behavior/output of other applications.

The resulting format will look like this

```
[10:20:00.064] timebase_callback is new_pos:1 nframes:512 frame:0 tickPos:0 cpos:0
[10:20:01.062] JackAudioDevice::setMaster val:1 unconditional:0
[10:20:01.067] timebase_callback() state:0
[10:20:01.067] timebase_callback BBT:
 bar:1 beat:1 tick:0
 bar_start_tick:0.000000 beats_per_bar:4.000000 beat_type:4.000000 ticks_per_beat:384.000000 beats_per_minute:120.000000
[10:20:01.067] pos_to_jack_position new: bar:1 beat:1 tick:0
 bar_start_tick:0.000000 beats_per_bar:4.000000 beat_type:4.000000 ticks_per_beat:384.000000 beats_per_minute:120.000000

```

Personally, I am more a fan of wrapping the log code in a function call than a multiline macro, but I did not wanted refactor your code (without asking first)
@luzpaz
Copy link
Contributor

luzpaz commented Nov 15, 2024

this is a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants