mozilla / cubeb-rs

ISC License
61 stars 19 forks source link

Only print filename in the log #50

Closed ChunMinChang closed 4 years ago

ChunMinChang commented 4 years ago

Instead of printing the full path to the file that is currently running, we should print the filename only. As long as we have the filename and the line, we know where the log comes from.

This is a fix for BMO 1628132. r? @kinetiknz


This change is Reviewable

ChunMinChang commented 4 years ago

This causes different behavior of what we do in C backends.

To make the log consistent, we could probably do the following in cubeb_log.h.

#define __FILENAME__ (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
g_cubeb_log_callback("%s:%d: " fmt "\n",  __FILENAME__, __LINE__, ##__VA_ARGS__);
kinetiknz commented 4 years ago

Thanks, LGTM.

This causes different behavior of what we do in C backends.

Your suggestions for addressing this seems good.