Skip to content

Commit b0f219c

Browse files
committed
Remove redundant logger code
1 parent c0e3051 commit b0f219c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
"**/frontmatter.json": "jsonc",
7474
"**/.frontmatter/config/*.json": "jsonc",
7575
"iosfwd": "cpp",
76-
"__node_handle": "c"
76+
"__node_handle": "c",
77+
"valkey_glide_cluster_arginfo.h": "c"
7778
},
7879
"php.validate.enable": true,
7980
"php.validate.executablePath": "/usr/bin/php",

logger.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
* Internal State Management - Singleton Pattern like Node.js Logger
1515
* ============================================================================ */
1616

17-
static bool logger_initialized = false;
18-
static int current_log_level = VALKEY_LOG_LEVEL_DEFAULT;
17+
static bool logger_initialized = false;
18+
static int current_log_level = VALKEY_LOG_LEVEL_DEFAULT;
19+
#if LOGGER_FFI_ENABLED
1920
static enum Level current_ffi_log_level = LEVEL_WARN; /* FFI level tracking */
21+
#endif
2022

2123
/* Simple mutex simulation using static variable for initialization protection */
2224
static volatile bool initialization_in_progress = false;
@@ -25,6 +27,7 @@ static volatile bool initialization_in_progress = false;
2527
* Level Conversion Functions
2628
* ============================================================================ */
2729

30+
#if LOGGER_FFI_ENABLED
2831
/**
2932
* Convert C integer log level to FFI Level enum
3033
*/
@@ -68,7 +71,7 @@ static int ffi_level_to_int(enum Level level) {
6871
return VALKEY_LOG_LEVEL_WARN; /* Default fallback */
6972
}
7073
}
71-
74+
#endif
7275
/* ============================================================================
7376
* Utility Functions
7477
* ============================================================================ */
@@ -187,10 +190,11 @@ void valkey_glide_logger_log(const char* level, const char* identifier, const ch
187190
return;
188191
}
189192

190-
int level_int = valkey_glide_logger_level_from_string(level);
193+
int level_int = valkey_glide_logger_level_from_string(level);
194+
#if LOGGER_FFI_ENABLED
191195
enum Level ffi_level = int_to_ffi_level(level_int);
192196

193-
#if LOGGER_FFI_ENABLED
197+
194198
/* Call the new FFI log function with current logger level */
195199
valkey_log(ffi_level, current_ffi_log_level, identifier, message);
196200
#endif

0 commit comments

Comments
 (0)