gulp-cli
gulp-cli copied to clipboard
potential for black-holing log messages via transitive dependency on gulplog
gulp-util.log
checks for hasGulplog
on module initialization and if present, defers logging to gulplog.info
, which in turn will eat any messages below error
(I believe) unless there is explicitly an event handler for the other levels (info, warn, etc.).
This can happen 'accidentally' if a transitive dependency uses gulplog.
It seems like the reasonable thing to do is to use gulplog.error
to ensure all logging is output properly.
gulplog.info
is the default log level for gulp-cli, which is why we used it (aligns with console.log
). The only messages that aren't logged by default is gulplog.debug
. However, I think you might actually be saying that some dependency is using gulplog
, which makes it available in the global scope but you aren't using the new gulp-cli, so no logs are being logged. Is that correct?
However, I think you might actually be saying that some dependency is using gulplog, which makes it available in the global scope but you aren't using the new gulp-cli, so no logs are being logged. Is that correct?
Correct and I can verify that using the gulp
executable from gulp-cli
produces the desired behavior, i.e. gulp-util.log
produces output even when gulplog
is present.
This is fine longer term, but it seems like a potential problem for the unaware - case in point: me and my time lost :(
Super simple example
require('gulplog');
require('gulp-util').log('foobar');
When run using global gulp, no 'foobar'. When using locally installed gulp
from gulp-cli
, 'foobar' is logged.
Thanks :smile:
Is the solution for gulp-util.log
to check (the yet-to-be-created) hasGulpCli
, instead of hasGulplog
?
Is the solution for gulp-util.log to check (the yet-to-be-created) hasGulpCli, instead of hasGulplog?
It could be? Unfortunately, I've moved on and no longer use gulp in my day-to-day work.
I'd like to close this issue following the deprecation of plugin-error
.
Is this problem still present? If so, where should this be moved, gulplog
?
/cc @phated
Yes, this is still a gulplog
issue, I've created an SSCCE at https://gist.github.com/bdukes/5d3d48321ba96f035311ee9f63aace70
This problem won't be solved until we get the community transferred off gulp installed globally and installing gulp-cli instead ☹️
@phated Is this issue in gulp v4? Only v3?
Or does this issue occur as long as gulplog
uses a global logger?
Is there anything we can do for this issue, though this is on the project board of v5
.
I think this is always going to be a problem. It's on the "nice to have" for v5 in case someone comes up with a good solution.