write method
Implementation
write(String debug, {String? function}) async {
await getPath();
final file = File('$path/log.txt');
final json = jsonEncode({
'debug': debug,
'time': DateTime.now().toString(),
'path': path,
'function': function ?? '',
});
file.writeAsString('$json\n', mode: FileMode.append);
}