-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a05f88c
commit 2d24f98
Showing
5 changed files
with
99 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:logger/logger.dart'; | ||
|
||
class AppConsoleOutput extends LogOutput { | ||
AppConsoleOutput(); | ||
|
||
@override | ||
void output(OutputEvent event) async { | ||
for (var line in event.lines) { | ||
debugPrint(line); //print to console as well | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:logger/logger.dart'; | ||
import 'package:path/path.dart' as p; | ||
import 'dart:io'; | ||
|
||
import 'package:path_provider/path_provider.dart'; | ||
|
||
class AppFileOutput extends LogOutput { | ||
AppFileOutput(); | ||
|
||
late File file; | ||
|
||
@override | ||
void output(OutputEvent event) async { | ||
final appDir = await getApplicationDocumentsDirectory(); | ||
final path = p.join(appDir.path, 'ReliabilityApp', 'iko_reliability.log'); | ||
late File file = File(path); | ||
|
||
for (var line in event.lines) { | ||
await file.writeAsString("${line.toString()}\n", | ||
mode: FileMode.writeOnlyAppend); | ||
debugPrint(line); //print to console as well | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters