setLog method
Implementation
Future<LogStatus> setLog(
{required String errorTitle,
required String errorMessage,
required LogLevel level}) async {
try {
String logEntry =
'${DateTime.now()};${level.toString().split('.').last.toUpperCase()};$errorTitle;$errorMessage\n';
await logFile?.writeAsString(logEntry, mode: FileMode.append);
return LogStatus(status: true, msg: "Log Saved Successfully");
} catch (e) {
return LogStatus(status: false, msg: e.toString());
}
}