logDebug static method

void logDebug(
  1. String message, {
  2. String? tag,
  3. Map<String, dynamic>? data,
})

Logs a debug message using Logar.

This method logs detailed information useful for development and debugging purposes. Debug logs are typically only shown in development builds.

Parameters:

  • message - The debug message to log
  • tag - Optional tag for categorizing the log entry
  • data - Optional additional data for context

Usage

// Log detailed payment processing steps
AmwalLogger.logDebug(
  'Validating payment request',
  tag: 'PAYMENT_VALIDATION',
  data: {
    'requestData': request.toJson(),
    'validationRules': validationRules,
  },
);

// Log API request details
AmwalLogger.logDebug(
  'Making API request to payment gateway',
  tag: 'API_REQUEST',
  data: {
    'endpoint': '/api/payments',
    'headers': requestHeaders,
    'payload': requestBody,
  },
);

When to Use

Use this method for:

  • Detailed operation steps
  • API request/response details
  • Validation and processing logic
  • Performance profiling
  • Development troubleshooting

Production Behavior

Debug logs are typically:

  • Disabled in production builds
  • Filtered by log level configuration
  • Used only for development and testing

Implementation

static void logDebug(
  String message, {
  String? tag,
  Map<String, dynamic>? data,
}) {
  Logar.debug(message, tag: tag ?? 'AMWAL_LOGGER', data: data);
}