Log constructor

Log({
  1. String? key,
  2. String? type,
  3. int? epoch,
  4. String? message,
  5. String? caller,
})

Implementation

Log(
    {String? key,
    String? type,
    int? epoch,
    String? message,
    String? caller}) {
  _map["key"] = key ?? newId();
  _map["type"] = type ?? "error";
  _map["epoch"] = epoch ?? DateTime.now().millisecondsSinceEpoch;
  _map["date"] = DateFormat("yyyy-MM-dd HH:mm:ss.sss")
      .format(DateTime.fromMillisecondsSinceEpoch(this.epoch));
  _map["message"] = message ?? "";
  _map["caller"] = caller;
}