DEV Community

zhonghua
zhonghua

Posted on

ULog-flutter beautiful log

ULog

Imitate Android logger library logger

start using

//Initialization
    ULog.init((value){
      return ""; // your JSON parsing library
    });
//Add a log adapter, which can be inherited to print different contents under different circumstances
    ULog.addLogAdapter(ULogConsoleAdapter());
Enter fullscreen mode Exit fullscreen mode

Output

Daily printing
Alt Text
Alt Text
If a line exceeds 4000 characters, it will be automatically folded
Alt Text

Log level

    ULog.v("12321321\ndfafdasfdsa\ndafdasf");
    ULog.d("12321321");
    ULog.i("12321321");
    ULog.w("12321321");
    ULog.e("1321231",error: NullThrownError());
    var map = [];
    map.add("1232");
    map.add("1232");
    map.add("1232");
    map.add("1232");
    ULog.e(map,error: NullThrownError());
    ULog.json('''
     {
      "a1": "value",
    "a2": 42,
    "bs": [
    {
    "b1": "any value",
    "b2": 13
    },
    {
    "b1": "another value",
    "b2": 0
    }
    ]
    }
    ''');

    // ULog.o(User("123","123"));
    ULog.e("1321231",error: NullThrownError(),tag: "12312");
    ULog.e("123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321123213211232132112321321");

Enter fullscreen mode Exit fullscreen mode

Discussion (0)