import 'dart:developer';

import 'package:flutter/foundation.dart';

class Logger {
  static void error(e, {String? message}) {
    log(
      e.toString(),
      error: message ?? e,
      level: 2000,
      stackTrace: StackTrace.current,
      name: 'ERROR',
    );
  }

  static debug(dynamic msg, {String? message}) {
    if (kDebugMode) {
      log(
        msg.toString(),
        name: message ?? msg.runtimeType.toString(),
      );
    }
  }
}

const error = Logger.error;
const debug = Logger.debug;
