Redirecting output
redirect stdout to a log
import 'package:dcli/dcli.dart';
void main() {
import 'package:dcli/dcli.dart';
void main() {
const pathToLog = 'log.txt';
print('running ls');
'ls *'.start(progress: Progress(pathToLog.append));
print('Displaying the log file');
cat(pathToLog);
}
Redirect stderr
long hand
dealing with errors
Last updated
Was this helpful?