You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <p align="center">
  2. <a href="http://gulpjs.com">
  3. <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  4. </a>
  5. </p>
  6. # gulplog
  7. [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Gitter chat][gitter-image]][gitter-url]
  8. Logger for gulp and gulp plugins
  9. ## Usage
  10. ```js
  11. var logger = require('gulplog');
  12. // logs strings
  13. logger.debug('The MOST verbose!');
  14. logger.info('Some important info');
  15. logger.warn('All the warnings to you');
  16. logger.error('OH NO! SOMETHING HAPPENED!');
  17. // supports util.format!
  18. logger.info('%s style!', 'printf');
  19. // log anything
  20. logger.debug({ my: 'obj' });
  21. logger.info([1, 2, 3]);
  22. ```
  23. ## API
  24. Logging (and level of logging) is controlled by [`gulp-cli`][gulp-cli-url]
  25. #### logger.debug(msg)
  26. Highest log level. Typically used for debugging purposes.
  27. If the first argument is a string, all arguments are passed to node's
  28. [`util.format()`][util-format-url] before being emitted.
  29. #### logger.info(msg)
  30. Standard log level. Typically used for user information.
  31. If the first argument is a string, all arguments are passed to node's
  32. [`util.format()`][util-format-url] before being emitted.
  33. #### logger.warn(msg)
  34. Warning log level. Typically used for warnings.
  35. If the first argument is a string, all arguments are passed to node's
  36. [`util.format()`][util-format-url] before being emitted.
  37. #### logger.error(msg)
  38. Error log level. Typically used when things went horribly wrong.
  39. If the first argument is a string, all arguments are passed to node's
  40. [`util.format()`][util-format-url] before being emitted.
  41. ## License
  42. MIT
  43. [downloads-image]: http://img.shields.io/npm/dm/gulplog.svg
  44. [npm-url]: https://npmjs.org/package/gulplog
  45. [npm-image]: http://img.shields.io/npm/v/gulplog.svg
  46. [travis-url]: https://travis-ci.org/gulpjs/gulplog
  47. [travis-image]: http://img.shields.io/travis/gulpjs/gulplog.svg
  48. [gitter-url]: https://gitter.im/gulpjs/gulp
  49. [gitter-image]: https://badges.gitter.im/gulpjs/gulp.png
  50. [gulp-cli-url]: https://github.com/gulpjs/gulp-cli
  51. [util-format-url]: https://nodejs.org/docs/latest/api/util.html#util_util_format_format