LCOV - code coverage report
Current view: top level - lib/matrix_api_lite/utils - print_logs_native.dart (source / functions) Hit Total Coverage
Test: merged.info Lines: 20 20 100.0 %
Date: 2024-11-12 07:37:08 Functions: 0 0 -

          Line data    Source code
       1             : import 'package:matrix/matrix_api_lite.dart';
       2             : 
       3             : extension PrintLogs on LogEvent {
       4          37 :   void printOut() {
       5          37 :     var logsStr = title;
       6          37 :     if (exception != null) {
       7          80 :       logsStr += ' - ${exception.toString()}';
       8             :     }
       9          37 :     if (stackTrace != null) {
      10          60 :       logsStr += '\n${stackTrace.toString()}';
      11             :     }
      12          74 :     if (Logs().nativeColors) {
      13          37 :       switch (level) {
      14          37 :         case Level.wtf:
      15           1 :           logsStr = '\x1B[31m!!!CRITICAL!!! $logsStr\x1B[0m';
      16             :           break;
      17          37 :         case Level.error:
      18          18 :           logsStr = '\x1B[31m$logsStr\x1B[0m';
      19             :           break;
      20          34 :         case Level.warning:
      21          33 :           logsStr = '\x1B[33m$logsStr\x1B[0m';
      22             :           break;
      23          32 :         case Level.info:
      24          32 :           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          74 :     print('[Matrix] $logsStr');
      35             :   }
      36             : }

Generated by: LCOV version 1.14