aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Lizza <marco.lizza@gmail.com>2019-01-20 22:24:09 +0100
committerMarco Lizza <marco.lizza@gmail.com>2019-01-20 22:24:09 +0100
commit932e9dbd090e48d96be8636beaaebcf11c2f9117 (patch)
tree39e2c6174263279b5713c5f16e495627172bd4a6 /src
parent78904d2bcc7345d74a59dd4dd44da685207cf787 (diff)
downloadraylib-932e9dbd090e48d96be8636beaaebcf11c2f9117.tar.gz
raylib-932e9dbd090e48d96be8636beaaebcf11c2f9117.zip
Fixing logging level configuration API.
Diffstat (limited to 'src')
-rw-r--r--src/raylib.h6
-rw-r--r--src/utils.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/raylib.h b/src/raylib.h
index 2210915f..325a1777 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -819,7 +819,7 @@ typedef enum {
} NPatchType;
// Callbacks to be implemented by users
-typedef void (*TraceLogCallback)(int msgType, const char *text, va_list args);
+typedef void (*TraceLogCallback)(TraceLogType logType, const char *text, va_list args);
#if defined(__cplusplus)
extern "C" { // Prevents name mangling of functions
@@ -899,9 +899,9 @@ RLAPI Color Fade(Color color, float alpha); // Color fade-
// Misc. functions
RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS)
-RLAPI void SetTraceLog(unsigned char types); // Enable trace log message types (bit flags based)
+RLAPI void SetTraceLogLevel(TraceLogType logType); // Set the current threshold (minimum) log level.
RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging bypassing raylib's one
-RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)
+RLAPI void TraceLog(TraceLogType logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)
RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png)
RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)
diff --git a/src/utils.c b/src/utils.c
index 9a312296..e9f46187 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -52,8 +52,8 @@
// Global Variables Definition
//----------------------------------------------------------------------------------
-// Log types messages supported flags (bit based)
-static unsigned char logTypeFlags = LOG_INFO | LOG_WARNING | LOG_ERROR;
+// Log types messages
+static TraceLogType logTypeLevel = LOG_INFO;
static TraceLogCallback logCallback = NULL;
#if defined(PLATFORM_ANDROID)
@@ -79,10 +79,10 @@ static int android_close(void *cookie);
// Module Functions Definition - Utilities
//----------------------------------------------------------------------------------
-// Enable trace log message types (bit flags based)
-void SetTraceLog(unsigned char types)
+// Set the current threshold (minimum) log level.
+void SetTraceLogLevel(TraceLogType logType)
{
- logTypeFlags = types;
+ logTypeLevel = logType;
}
// Set a trace log callback to enable custom logging bypassing raylib's one