Skip to content
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

Allow logging to be tuned #92

Open
mojavelinux opened this issue Feb 11, 2018 · 1 comment
Open

Allow logging to be tuned #92

mojavelinux opened this issue Feb 11, 2018 · 1 comment

Comments

@mojavelinux
Copy link
Contributor

This library can be used in an application based on vinyl streams, outside of the context of Gulp (see below). In this context, the logging is a nuisance. Allow the logging to be tuned either globally or via the constructor (whichever makes more sense). If this is just a matter of documentation, simply add instructions to the README that explain how to control and tune the logging.

const GulpSSH = require('gulp-ssh')
const vfs = require('vinyl-fs')

;(async () => {
  const gulpSSH = new GulpSSH({
    ignoreErrors: false,
    sshConfig: { username: process.env.USER, agent: process.env.SSH_AUTH_SOCK }
  })
  await new Promise((resolve, reject) => {
    vfs
      .src('*.zip')
      .pipe(gulpSSH.dest('/tmp'))
      .on('error', reject)
      .on('finish', resolve)
  })
})()
@dvsoukup
Copy link

+1

I agree. I like gulpssh, but the logging is a hassle. I'd like to suppress much of it, especially when copying files over .dest()

I poked through the source and it looks like it uses npm fancy-log. Most of these various classes (ie, exec, dest, ssh...) allow for an options parameters.

Someone just needs to open a pull request and create this logging option. Doesn't seem like it would be all that difficult. One option to globally shutdown all gulpssh log output, and also you can individually passing logging in to each utility function.. something like:

 return gulp.src(deployFiles)
    .pipe(gssh.dest(config.remoteSettings.destination, {showOutput: false}));

Alternatively, could do it a bit more complicated and allow to set logging levels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants