todayLog2File static method

Future<String> todayLog2File([
  1. String? filePath,
  2. List<WLogLevel> levelList = WLogLevel.values
])

导出今天日志到文件

Implementation

static Future<String> todayLog2File([
  String? filePath,
  List<WLogLevel> levelList = WLogLevel.values,
]) async {
  final today = DateTime.now().toIso8601String().split("T").first;

  final startTime = DateTime.parse("$today 00:00:00");
  final endTime = DateTime.parse("$today 23:59:59");

  filePath ??= await WLogDBExport.generateFilePath("WLog_$today.txt");
  await log2File(filePath, startTime, endTime, levelList);
  return filePath;
}