Skip to content

Commit

Permalink
pulse: add timestamps to log output
Browse files Browse the repository at this point in the history
This helps a lot when debugging various underruns.
  • Loading branch information
marmarek committed Feb 22, 2024
1 parent 9029d0e commit 8874142
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pulse/pacat-simple-vchan.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ static void playback_stream_drain_cb(pa_stream *s, int success, void *userdata);

void pacat_log(const char *fmt, ...) {
va_list args;
struct timespec ts;

clock_gettime(CLOCK_REALTIME, &ts);

fprintf(stderr, "%10jd.%06ld ", ts.tv_sec, ts.tv_nsec / 1000);
va_start(args, fmt);
vfprintf(stderr, fmt, args);
va_end(args);
Expand Down

0 comments on commit 8874142

Please sign in to comment.