Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 登录Firebase上托管的Flatter Web应用程序_Flutter_Logging - Fatal编程技术网

Flutter 登录Firebase上托管的Flatter Web应用程序

Flutter 登录Firebase上托管的Flatter Web应用程序,flutter,logging,Flutter,Logging,我对颤栗还比较陌生。我正在开发一个在Firebase上托管的web应用程序。我希望实现日志记录(基于文件的日志记录),但似乎无法实现同样的web日志记录。对于Android/iOS来说,它是有效的。下面是我试过的 我试图检查链接到云日志的firebase日志,但我的主机没有显示任何内容。 其次,我尝试使用并创建了一个logger实例,如下所示 SizedBox( height: 700, child: LogConsole(

我对颤栗还比较陌生。我正在开发一个在Firebase上托管的web应用程序。我希望实现日志记录(基于文件的日志记录),但似乎无法实现同样的web日志记录。对于Android/iOS来说,它是有效的。下面是我试过的

我试图检查链接到云日志的firebase日志,但我的主机没有显示任何内容。

其次,我尝试使用并创建了一个logger实例,如下所示

SizedBox(
              height: 700,
              child: LogConsole(
                showCloseButton: false,
                dark: Theme.of(context).brightness == Brightness.dark,
              ),
 )
类日志服务{ 静态记录器singletonObj=null

  static Logger getSingletonInstance() {
    if(singletonObj==null){
      singletonObj = new Logger( printer: PrettyPrinter(
        methodCount: 0,
        errorMethodCount: 5,
        lineLength: 50,
        colors: true,
        printEmojis: true,
        printTime: false,
      ),);
    }
    return singletonObj;
  }
}
并试图以这种方式记录

runZonedGuarded(() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp();
    LogConsole.init();
    Logger.level = Level.verbose;
   FlutterError.onError = (FlutterErrorDetails details) {
      FlutterError.dumpErrorToConsole(details);
      LoggerService.getSingletonInstance().wtf(details);
    };
    runApp(MyApp());
  }, (Object error, StackTrace stack) {
    LoggerService.getSingletonInstance().wtf(error);
  });
为了查看日志,我尝试使用下面的示例在窗口中打印日志

SizedBox(
              height: 700,
              child: LogConsole(
                showCloseButton: false,
                dark: Theme.of(context).brightness == Brightness.dark,
              ),
 )
在本地运行时,我有时会看到日志,但在部署时,什么都不会显示

有什么建议我可以纠正这一点或以其他方式实施它

谢谢