about summary refs log tree commit diff stats
path: root/js/scripting-lang/baba-yaga-c/src/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/baba-yaga-c/src/debug.c')
-rw-r--r--js/scripting-lang/baba-yaga-c/src/debug.c116
1 files changed, 0 insertions, 116 deletions
diff --git a/js/scripting-lang/baba-yaga-c/src/debug.c b/js/scripting-lang/baba-yaga-c/src/debug.c
deleted file mode 100644
index c509969..0000000
--- a/js/scripting-lang/baba-yaga-c/src/debug.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * @file debug.c
- * @brief Debug and logging implementation for Baba Yaga
- * @author eli_oat
- * @version 0.0.1
- * @date 2025
- * 
- * This file implements debug and logging functionality for the Baba Yaga language.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <time.h>
-
-#include "baba_yaga.h"
-
-/* ============================================================================
- * Debug State
- * ============================================================================ */
-
-static DebugLevel current_debug_level = DEBUG_NONE;
-
-/* ============================================================================
- * Debug Functions
- * ============================================================================ */
-
-/**
- * @brief Set debug level
- * 
- * @param level Debug level to set
- */
-void baba_yaga_set_debug_level(DebugLevel level) {
-    current_debug_level = level;
-}
-
-/**
- * @brief Get current debug level
- * 
- * @return Current debug level
- */
-DebugLevel baba_yaga_get_debug_level(void) {
-    return current_debug_level;
-}
-
-/**
- * @brief Get debug level name
- * 
- * @param level Debug level
- * @return String representation of debug level
- */
-static const char* debug_level_name(DebugLevel level) {
-    switch (level) {
-    case DEBUG_NONE: return "NONE";
-    case DEBUG_ERROR: return "ERROR";
-    case DEBUG_WARN: return "WARN";
-    case DEBUG_INFO: return "INFO";
-    case DEBUG_DEBUG: return "DEBUG";
-    case DEBUG_TRACE: return "TRACE";
-    default: return "UNKNOWN";
-    }
-}
-
-/**
- * @brief Get current timestamp
- * 
- * @return Current timestamp as string
- */
-static const char* get_timestamp(void) {
-    static char timestamp[32];
-    time_t now = time(NULL);
-    struct tm* tm_info = localtime(&now);
-    strftime(timestamp, sizeof(timestamp), "%H:%M:%S", tm_info);
-    return timestamp;
-}
-
-/**
- * @brief Debug logging function
- * 
- * @param level Debug level for this message
- * @param file Source file name
- * @param line Line number
- * @param func Function name
- * @param format Format string
- * @param ... Variable arguments
- */
-void baba_yaga_debug_log(DebugLevel level, const char* file, int line, 
-                        const char* func, const char* format, ...) {
-    if (level > current_debug_level) {
-        return;
-    }
-    
-    /* Get file name without path */
-    const char* filename = strrchr(file, '/');
-    if (filename == NULL) {
-        filename = file;
-    } else {
-        filename++; /* Skip the '/' */
-    }
-    
-    /* Print timestamp and level */
-    fprintf(stderr, "[%s] %-5s ", get_timestamp(), debug_level_name(level));
-    
-    /* Print location */
-    fprintf(stderr, "%s:%d:%s(): ", filename, line, func);
-    
-    /* Print message */
-    va_list args;
-    va_start(args, format);
-    vfprintf(stderr, format, args);
-    va_end(args);
-    
-    fprintf(stderr, "\n");
-    fflush(stderr);
-} 
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425