{"_id":"get-logger","_rev":"3-d5f4308a7ff64917839d1fbe56c8f66f","name":"get-logger","description":"Node.js logging facade to decouple frameworks, libraries and application code from specific logging implementations.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"get-logger","version":"1.0.0","main":"lib/logging.js","files":["lib","get-logger.d.ts"],"typescript":{"definition":"get-logger.d.ts"},"author":{"name":"Ben Ripkens","email":"bripkens@gmail.com","url":"http://github.com/bripkens"},"license":"MIT","repository":{"type":"git","url":"git://github.com/bripkens/get-logger.git"},"bugs":{"url":"https://github.com/bripkens/formalistic/issues"},"keywords":["logging","facade","slf4j","slf4js","logger","bunyan","pino"],"scripts":{"test":"yarn run test:unit && yarn run test:lint","test:lint":"semistandard */*.js","test:unit":"NODE_ENV=test jest --coverage","precommit":"yarn run test"},"devDependencies":{"husky":"^0.13.3","jest":"^19.0.2","semistandard":"^11.0.0","sinon":"^2.1.0","coveralls":"^2.13.1"},"gitHead":"d813a713a8e38f1257e2f7546c7d4bde050191dc","description":"Node.js logging facade to decouple frameworks, libraries and application code from specific logging implementations.","homepage":"https://github.com/bripkens/get-logger#readme","_id":"get-logger@1.0.0","_shasum":"9c7823b1c5e15faf2450047f24e51a1299d47374","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.9.5","_npmUser":{"name":"bripkens","email":"bripkens.dev@gmail.com"},"maintainers":[{"name":"bripkens","email":"bripkens.dev@gmail.com"}],"dist":{"shasum":"9c7823b1c5e15faf2450047f24e51a1299d47374","tarball":"https://registry.npmjs.org/get-logger/-/get-logger-1.0.0.tgz","integrity":"sha512-AMbRhx6dh4pZeZazyPCWCsQtoEfoy1GAWc7nUV68GxohspGsoerABrMZ2SYlq8l/ZYx940XF+a0q2oOLNo6xjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLrUSzDV22ujrOCe6cz2Jcx2yLd7JVl+7esYD4BT+LhgIhAJAtSB/kJVSlYvPc4WpoaiNgWRgifCnc8eFbLXBFOOXz"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/get-logger-1.0.0.tgz_1493635752571_0.6948145844507962"}}},"readme":"# get-logger &nbsp; [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Downloads][downloads-image]][npm-url]\n\nNode.js logging facade to decouple frameworks, libraries and application code from specific logging implementations.\n\n**[Installation](#installation) |**\n**[Usage](#usage) |**\n**[API](get-logger.d.ts) |**\n**[Changelog](CHANGELOG.md)**\n\n---\n\n`get-logger` is a facade for Node.js logging implementations like [bunyan](https://github.com/trentm/node-bunyan), [pino](https://github.com/pinojs/pino), [debug](https://github.com/visionmedia/debug) and others with the following goal:\n\n*Framework and library authors, as well as application developers, must be capable of adding logging to their code without relying on specific logging implementation.*\n\nThis means that `get-logger` is only a small facade over existing logging implementations. It defines a very small API surface area and a few contracts that logging implementations should support. All advanced features such as setting an active log level, defining output streams and the output format is left to the chosen logging implementation.\n\nBy default, `get-logger` will log to the `console`.\n\n\n## Installation\n\n```\nyarn add get-logger\n# -or-\nnpm install --save get-logger\n```\n\n## Usage\n`get-logger` is most helpful because your Node.js modules don't have to rely on specific logging implementations. Because of this, logging implementations can easily be changed. Furthermore, editor and IDEs can auto-generate these logger require statements.\n\n```javascript\nconst logger = require('get-logger')('<nameOfYourModule>');\n```\n\nLoggers support the following log levels and format strings:\n\n```javascript\nlogger.debug('Power level over %d!', 8000);\nlogger.info('One does not simply build a %s tool', 'chat');\nlogger.warn({foo: 'think-of-something-better-than-foo'});\nlogger.error('Sorry folks!', {error: 'ENOTFOUND'})\n```\n\nAt last, to configure `get-logger` to use a specific logging implementation, set the logger provider using `setLoggerProvider(name: string): Logger`.\n\n```javascript\nrequire('get-logger').setLoggerProvider(name => {\n  return {\n    debug,\n    info,\n    warn,\n    error\n  };\n});\n```\n\n[npm-url]: https://npmjs.org/package/get-logger\n[npm-image]: http://img.shields.io/npm/v/get-logger.svg\n\n[downloads-image]: http://img.shields.io/npm/dm/get-logger.svg\n\n[travis-url]: https://travis-ci.org/bripkens/get-logger\n[travis-image]: http://img.shields.io/travis/bripkens/get-logger.svg\n\n[coveralls-url]: https://coveralls.io/r/bripkens/get-logger\n[coveralls-image]: http://img.shields.io/coveralls/bripkens/get-logger/master.svg\n","maintainers":[{"name":"bripkens","email":"bripkens.dev@gmail.com"}],"time":{"modified":"2022-06-18T07:50:33.927Z","created":"2017-05-01T10:49:14.431Z","1.0.0":"2017-05-01T10:49:14.431Z"},"homepage":"https://github.com/bripkens/get-logger#readme","keywords":["logging","facade","slf4j","slf4js","logger","bunyan","pino"],"repository":{"type":"git","url":"git://github.com/bripkens/get-logger.git"},"author":{"name":"Ben Ripkens","email":"bripkens@gmail.com","url":"http://github.com/bripkens"},"bugs":{"url":"https://github.com/bripkens/formalistic/issues"},"license":"MIT","readmeFilename":"README.md","users":{"jsdnxx":true}}