logWarning static method

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

Logs a warning message using Logar.

This method logs warnings about potential issues or unexpected conditions that may cause problems but aren't critical errors.

Parameters:

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

Usage

// Log slow payment processing
AmwalLogger.logWarning(
  'Payment processing taking longer than expected',
  tag: 'PERFORMANCE',
  data: {
    'expectedTime': '2s',
    'actualTime': '5s',
    'transactionId': '123',
  },
);

// Log deprecated feature usage
AmwalLogger.logWarning(
  'Deprecated payment method used',
  tag: 'DEPRECATION',
  data: {
    'paymentMethod': 'legacy_wallet',
    'userId': 'user_456',
    'suggestedAlternative': 'new_wallet',
  },
);

When to Use

Use this method for:

  • Performance issues
  • Deprecated feature usage
  • Unexpected but non-critical conditions
  • Resource usage warnings
  • Configuration warnings

Warning Levels

Warnings indicate:

  • Potential problems that should be investigated
  • Issues that may impact user experience
  • Conditions that could lead to errors
  • Performance degradation
  • Security considerations

Implementation

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