/**
 * Simple debug logging utility to standardize log format with timestamps
 */
export const debugLog = (functionName, message, data = null) => {
  const timestamp = new Date().toISOString();
  const logPrefix = `[${timestamp}] [${functionName}]`;
  
  if (data) {
    console.group(`${logPrefix} ${message}`);
    console.log('Data:', data);
    console.groupEnd();
  } else {
    console.log(`${logPrefix} ${message}`);
  }
};

export const debugError = (functionName, message, error) => {
  const timestamp = new Date().toISOString();
  const logPrefix = `[${timestamp}] [${functionName}] ERROR`;
  
  console.group(`${logPrefix} ${message}`);
  console.error('Error Details:', error);
  if (error?.message) console.error('Message:', error.message);
  if (error?.code) console.error('Code:', error.code);
  if (error?.details) console.error('Details:', error.details);
  if (error?.hint) console.error('Hint:', error.hint);
  console.groupEnd();
};