log method

Future<void> log(
  1. String logMessage,
  2. Level logLevel, {
  3. Map<String, dynamic>? attributes,
})

Log message directly.

Implementation

Future<void> log(
  String logMessage,
  Level logLevel, {
  Map<String, dynamic>? attributes,
}) async {
  return await channel.invokeMethod('loggerLog', {
    'identifier': hashCode.toString(),
    'level': _levelAsStatus(logLevel),
    'message': logMessage,
    if (attributes != null)
      'attributes': platform.isIOS ? jsonEncode(attributes) : attributes,
  });
}