addLogFile static method

Future<void> addLogFile(
  1. String text, {
  2. String subDir = 'log',
  3. bool append = true,
})

Implementation

static Future<void> addLogFile(String text, {String subDir = 'log', bool append = true}) async {
  final File file = await _getSameDayFile(subDir: subDir);
  final DateTime date = DateTime.now();
  String log = '';
  log += '\n';
  log += '${date.toString()}\n';
  log += text;
  log += '\n\n';
  IsolateUtil.instance.sendLog([file, log, append]);
}