pipe gecko logs to flutter

This commit is contained in:
Fabian Freund
2025-08-12 21:06:48 +02:00
parent f70cc7acfa
commit 0b467bb2e4
7 changed files with 134 additions and 4 deletions
@@ -0,0 +1,29 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import 'package:flutter/services.dart';
import 'package:flutter_mozilla_components/src/pigeons/gecko.g.dart';
class GeckoLoggingService extends GeckoLogging {
final void Function(LogLevel level, String message) handleLog;
GeckoLoggingService.setUp(
this.handleLog, {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) {
GeckoLogging.setUp(
this,
binaryMessenger: binaryMessenger,
messageChannelSuffix: messageChannelSuffix,
);
}
@override
void onLog(LogLevel level, String message) {
handleLog(level, message);
}
}