LCOV - code coverage report
Current view: top level - lib/matrix_api_lite/utils - print_logs_native.dart (source / functions) Coverage Total Hit
Test: merged.info Lines: 100.0 % 20 20
Test Date: 2025-01-14 13:39:53 Functions: - 0 0

            Line data    Source code
       1              : import 'package:matrix/matrix_api_lite.dart';
       2              : 
       3              : extension PrintLogs on LogEvent {
       4           35 :   void printOut() {
       5           35 :     var logsStr = title;
       6           35 :     if (exception != null) {
       7           72 :       logsStr += ' - ${exception.toString()}';
       8              :     }
       9           35 :     if (stackTrace != null) {
      10           52 :       logsStr += '\n${stackTrace.toString()}';
      11              :     }
      12           70 :     if (Logs().nativeColors) {
      13           35 :       switch (level) {
      14           35 :         case Level.wtf:
      15            1 :           logsStr = '\x1B[31m!!!CRITICAL!!! $logsStr\x1B[0m';
      16              :           break;
      17           35 :         case Level.error:
      18           15 :           logsStr = '\x1B[31m$logsStr\x1B[0m';
      19              :           break;
      20           33 :         case Level.warning:
      21           33 :           logsStr = '\x1B[33m$logsStr\x1B[0m';
      22              :           break;
      23           31 :         case Level.info:
      24           31 :           logsStr = '\x1B[32m$logsStr\x1B[0m';
      25              :           break;
      26           31 :         case Level.debug:
      27           31 :           logsStr = '\x1B[34m$logsStr\x1B[0m';
      28              :           break;
      29           31 :         case Level.verbose:
      30              :           break;
      31              :       }
      32              :     }
      33              :     // ignore: avoid_print
      34           70 :     print('[Matrix] $logsStr');
      35              :   }
      36              : }
        

Generated by: LCOV version 2.0-1