log method

Future<void> log(
  1. String message, {
  2. LogType type = LogType.info,
  3. List<String> tags = const [],
})
inherited

Logs a message with the specified type and additional tags.

This is the primary logging method that merges the class's loggerTags with any additional tags provided in the call.

Example:

await log(
  'Processing payment for order ${orderId}',
  type: LogType.info,
  tags: ['processing', 'order_$orderId'],
);

Parameters:

  • message - The message to log
  • type - The type/severity of the message (default: info)
  • tags - Additional tags to merge with loggerTags

Tag Merging: The final tag list will be [...loggerTags, ...tags], so class tags appear first, followed by method-specific tags.

Throws:

  • LoggerException if the global logger has been disposed

Implementation

Future<void> log(
  String message, {
  LogType type = LogType.info,
  List<String> tags = const [],
}) async {
  await logger.log(message, type: type, tags: [...loggerTags, ...tags]);
}