【问题标题】:Printing colored message in debugging console in flutter application在颤振应用程序的调试控制台中打印彩色消息
【发布时间】:2021-09-15 18:18:06
【问题描述】:

我问是否有任何方法可以在调试控制台中打印彩色消息,而不仅仅是默认颜色。对调试过程有很大帮​​助。

如果它不依赖任何包,它会更有帮助。

【问题讨论】:

    标签: flutter dart visual-studio-code


    【解决方案1】:

    您可以为此使用 Flutter 开发者日志。

    import 'dart:developer' as developer;
    

    您可以在代码中的任何位置登录。

     developer.log('log me', name: 'my.app.category');
     developer.log('log me 1', name: 'my.other.category');
     developer.log('log me 2', name: 'my.other.category');
    

    更多详情见。 https://flutter.dev/docs/testing/code-debugging#logging

    【讨论】:

      【解决方案2】:

      试试这个

      pip install colored
      

      我是怎么找到的?

      pypi color print 
      

      在谷歌上

      【讨论】:

      • 我问的是颤振而不是 python @Bahae。感谢您的努力。
      猜你喜欢
      • 2020-02-15
      • 1970-01-01
      • 1970-01-01
      • 2010-09-18
      • 1970-01-01
      • 2010-10-28
      • 2018-01-27
      • 1970-01-01
      • 2021-09-23
      相关资源
      最近更新 更多