Commit 216d4498 authored by Zachary Cook's avatar Zachary Cook
Browse files

Override lightrec's debug.h with one that uses log_cb

parent 9981f11a
Pipeline #48024 passed with stage
in 3 minutes and 33 seconds
......@@ -197,7 +197,8 @@ ifeq ($(HAVE_LIGHTREC), 1)
INCFLAGS += -I$(DEPS_DIR)/lightning/include \
-I$(DEPS_DIR)/lightrec \
-I$(CORE_DIR)/lightning-lightrec-include
-I$(CORE_DIR)/lightning-lightrec-include \
-include $(CORE_DIR)/lightning-lightrec-include/debug.h
endif
ifneq ($(HAVE_GRIFFIN), 1)
......
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2014-2021 Paul Cercueil <paul@crapouillou.net>
*/
#ifndef DEBUG_H
#define DEBUG_H
#include <stdio.h>
#include <unistd.h>
#include <libretro.h>
extern retro_log_printf_t log_cb;
#define NOLOG_L 0
#define ERROR_L 1
#define WARNING_L 2
#define INFO_L 3
#define DEBUG_L 4
#ifndef LOG_LEVEL
#define LOG_LEVEL INFO_L
#endif
// -------------
#if (LOG_LEVEL >= DEBUG_L)
# define pr_debug(...) \
log_cb(RETRO_LOG_DEBUG, "[Lightrec]: " __VA_ARGS__)
#else
#define pr_debug(...)
#endif
#if (LOG_LEVEL >= INFO_L)
# define pr_info(...) \
log_cb(RETRO_LOG_INFO, "[Lightrec]: " __VA_ARGS__)
#else
#define pr_info(...)
#endif
#if (LOG_LEVEL >= WARNING_L)
# define pr_warn(...) \
log_cb(RETRO_LOG_WARN, "[Lightrec]: " __VA_ARGS__)
#else
#define pr_warn(...)
#endif
#if (LOG_LEVEL >= ERROR_L)
# define pr_err(...) \
log_cb(RETRO_LOG_ERROR, "[Lightrec]: " __VA_ARGS__)
#else
#define pr_err(...)
#endif
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment