đ<?php
// debug_helper.php - Guarda este archivo en el mismo directorio

function create_debug_log() {
    $log_file = __DIR__ . '/debug_detailed.txt';
    $timestamp = date("Y-m-d H:i:s");
    $log_message = "=== INICIO DE SESIÓN DE DEPURACIÓN [{$timestamp}] ===\n";
    file_put_contents($log_file, $log_message, FILE_APPEND | LOCK_EX);
    return $log_file;
}

function write_debug_log($message, $log_file) {
    $timestamp = date("Y-m-d H:i:s");
    $log_message = "[{$timestamp}] {$message}\n";
    file_put_contents($log_file, $log_message, FILE_APPEND | LOCK_EX);
}

function close_debug_log($log_file) {
    $timestamp = date("Y-m-d H:i:s");
    $log_message = "=== FIN DE SESIÓN DE DEPURACIÓN [{$timestamp}] ===\n\n";
    file_put_contents($log_file, $log_message, FILE_APPEND | LOCK_EX);
}
?>