-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process listen invalid #111
Comments
Received upon completion of task execution log,solution? |
I'm not I completely understand the question but if you want to listen to the stdout/strerr stream you have to create a controller. There is a completely undocumented ShellLinesController ( process_run.dart/packages/process_run/test/doc_test.dart Lines 20 to 21 in f2bd2e9
|
Hello, I just tried controller.stream.listen but there is still no log output. Is it necessary to configure properties when logging through CMD on Windows |
I don't which app you are spawning and whether it does have output (many windows app simply don't output anything). Sometimes the option You can try with a simple |
The cmd command-line tool for Windows can view logs in real-time, but onProcess can only receive logs after the task is completed and cannot obtain logs in real-time |
I'm not sure what you are trying to achieve sorry, no need to use onProcess. Can you try the following example: import 'dart:io';
import 'package:process_run/shell.dart';
void main(List<String> arguments) async {
var outController = ShellLinesController();
outController.stream.listen((event) {
stdout.writeln('[out]: $event');
});
var errController = ShellLinesController();
errController.stream.listen((event) {
stdout.writeln('[err]: $event');
});
var shell = Shell(
stdout: outController.sink,
stderr: errController.sink,
verbose: false,
throwOnError: false);
await shell.run('''
cmd /c echo "One line on stdout" \\
& echo "Another line on stdout" \\
& echo "One line on stderr" 1>&2 \\
& ping localhost
'''); It should display something like this (displayed in real time)
|
thank
thank |
hello process.stderr.transform and process.stdout.transform not have log?
The text was updated successfully, but these errors were encountered: