-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Logging mixed up with asynchronous tasks #361
Comments
I'd like to see gulp itself handling this. It would mean that it automatically works for all plugins and that it could do it in a clean, consistent and configurable manner. Another argument for this is that many plugins are only very thin wrappers for other libraries, and that handling this themselves would make them unnecessarily more complex, and in this case the wrapped libraries themselves are responsible for logging to the console, the plugin can't do more about it than gulp itself could. I haven't really looked into possible solutions yet, but the first thing that comes to my mind is replacing the methods of interest from Libraries such as mocha execute a task that can take anything from a fraction of a second to a couple of minutes or even hours to complete. In the case of mocha, it makes a lot of sense to log its status continuously. However, this solution introduces a lot of complexity for a more or less simple problem. I'm not sure if it's worth it, although I don't consider wanting to have clean logs to be an edge case. Having a simple way of running tasks serially might not be the ideal solution for this specific issue, but a simpler and more generally applicable one than introducing a complex and confusing system to configure logging behaviour. |
Not sure if this is strictly related (looks like it), but in my case it looks like gulp.task('build', ['clean:dist', 'templates:dist', 'scripts:dist']); $ time gulp build
[gulp] Using gulpfile /Users/olivier/Dropbox/Projects/angular-strap/gulpfile.js
[gulp] Starting 'clean:dist'...
[gulp] Finished 'clean:dist' after 4.25 ms
[gulp] Starting 'templates:dist'...
[gulp] Finished 'templates:dist' after 7.1 ms
[gulp] Starting 'scripts:dist'...
[gulp] Finished 'scripts:dist' after 2.34 ms
[gulp] Starting 'build'...
[gulp] Finished 'build' after 4.77 μs
real 0m5.041s
user 0m4.915s
sys 0m0.173s I'm expecting it to be something like: $ time gulp build
[gulp] Using gulpfile /Users/olivier/Dropbox/Projects/angular-strap/gulpfile.js
[gulp] Starting 'build'...
[gulp] Starting 'clean:dist'...
[gulp] Starting 'templates:dist'...
[gulp] Starting 'scripts:dist'...
[gulp] Finished 'clean:dist' after 4.25 ms
[gulp] Finished 'templates:dist' after 2.1 s
[gulp] Finished 'scripts:dist' after 2.34 s
[gulp] Finished 'build' after 5.041s
real 0m5.041s
user 0m4.915s
sys 0m0.173s |
I wouldn't have expected the second log at all. It implies that the other tasks were started after the task you ran started, which isn't the case at all. To be clear, when I say "started" I mean that the function you passed in has begun executing. I would expect an output like the second if you manually call other tasks within a single task. |
Just to keep everyone updated, we are completely replacing the logging and task system in gulp 4.0 so we will make sure this is fixed then |
Note: this will only be handled when logging is done through gulp-util.log (soon to be gulplog) |
Ref #1208 |
Since new logging is done, how does this issue need to be addressed? |
@kahlil I'm not sure how this would be tackled. Any ideas? |
Deferring to gulp-cli 1.2.0 |
Moved to gulpjs/gulp-cli#72 - Closing. |
3rd party modules that log progressively/asynchronously will get stuff mixed in from other tasks
This will have to be fixed at the plugin level or we could do some trickery at the task level
The text was updated successfully, but these errors were encountered: