Add generic LOG() macro with level parameter

One log macro was provided for each log level (LOGV(), LOGD(), LOGI(),
LOGW(), LOGE()).

Add a generic macro LOG(LEVEL, ...) accepting a log level as parameter,
so that it is possible to write logging wrappers.

PR #3005 <https://github.com/Genymobile/scrcpy/pull/3005>
This commit is contained in:
Romain Vimont
2022-02-05 14:18:12 +01:00
parent 61b6324ee9
commit 6df2205cf3
2 changed files with 14 additions and 0 deletions

View File

@@ -25,6 +25,10 @@ sc_set_log_level(enum sc_log_level level);
enum sc_log_level
sc_get_log_level(void);
void
sc_log(enum sc_log_level level, const char *fmt, ...);
#define LOG(LEVEL, ...) sc_log((LEVEL), __VA_ARGS__)
#ifdef _WIN32
// Log system error (typically returned by GetLastError() or similar)
bool