import 'dart:developer' as developer;

///@Description     Logger
///@author          helinlin
///@create          2021-11-30 14:44
class Logger {
  static LoggerType type = LoggerType.DEBUG;

  static void debug(String message) {
    if (type.index < LoggerType.DEBUG.index) {
      developer.log('DEBUG  $message', name: 'Amos');
    }
  }

  static void info(String message) {
    if (type.index < LoggerType.INFO.index) {
      developer.log('INFO  $message', name: 'Amos');
    }
  }

  static void warn(String message) {
    if (type.index < LoggerType.WARN.index) {
      developer.log('WARN  $message', name: 'Amos');
    }
  }

  static void error(String message) {
    if (type.index < LoggerType.ERROR.index) {
      developer.log('ERROR  $message', name: 'Amos');
    }
  }
}

enum LoggerType { DEBUG, INFO, WARN, ERROR }
