Browse Source

Fixing logging level configuration API.

pull/731/head
Marco Lizza 6 years ago
parent
commit
932e9dbd09
2 changed files with 8 additions and 8 deletions
  1. +3
    -3
      src/raylib.h
  2. +5
    -5
      src/utils.c

+ 3
- 3
src/raylib.h View File

@ -819,7 +819,7 @@ typedef enum {
} NPatchType; } NPatchType;
// Callbacks to be implemented by users // Callbacks to be implemented by users
typedef void (*TraceLogCallback)(kt">int msgType, const char *text, va_list args);
typedef void (*TraceLogCallback)(n">TraceLogType logType, const char *text, va_list args);
#if defined(__cplusplus) #if defined(__cplusplus)
extern "C" { // Prevents name mangling of functions extern "C" { // Prevents name mangling of functions
@ -899,9 +899,9 @@ RLAPI Color Fade(Color color, float alpha); // Color fade-
// Misc. functions // Misc. functions
RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS) 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 SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging bypassing raylib's one
RLAPI void TraceLog(kt">int logType, const char *text, ...); // Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)
RLAPI void TraceLog(n">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 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) RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included)

+ 5
- 5
src/utils.c View File

@ -52,8 +52,8 @@
// Global Variables Definition // Global Variables Definition
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Log types messages supported flags (bit based)
static kt">unsigned char logTypeFlags = LOG_INFO | LOG_WARNING | LOG_ERROR;
// Log types messages
static n">TraceLogType logTypeLevel = LOG_INFO;
static TraceLogCallback logCallback = NULL; static TraceLogCallback logCallback = NULL;
#if defined(PLATFORM_ANDROID) #if defined(PLATFORM_ANDROID)
@ -79,10 +79,10 @@ static int android_close(void *cookie);
// Module Functions Definition - Utilities // 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 // Set a trace log callback to enable custom logging bypassing raylib's one

Loading…
Cancel
Save