execute method

  1. @override
Future<bool?> execute(
  1. String caller,
  2. String propertyOrFunction,
  3. List arguments
)
override

Implementation

@override
Future<bool?> execute(
    String caller, String propertyOrFunction, List<dynamic> arguments) async {
  var function = propertyOrFunction.toLowerCase().trim();
  switch (function) {
    case "write":
      String? message = toStr(elementAt(arguments, 0));
      if (message != null) Log().info(message, caller: id);
      return true;

    case "export":
      String format = toStr(elementAt(arguments, 0))?.toLowerCase() ?? "html";
      bool history = toBool(elementAt(arguments, 1)) ?? false;
      Log().export(format: format, withHistory: history);
      return true;

    case "clear":
      Log().clear();
      return true;

    case 'start':
    case 'fire':
      super.onSuccess(Log().data);
      return true;
  }
  return super.execute(caller, propertyOrFunction, arguments);
}