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: 17 20 85.0 %
Date: 2024-07-12 20:20:16 Functions: 0 0 -

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

Generated by: LCOV version 1.14