{"name":"log","version":"3.2.0","description":"Universal pluggable logging utility","author":{"name":"Mariusz Nowak","email":"medyk@medikoo.com","url":"http://www.medikoo.com/"},"keywords":["log","logger","debug","bunyan","winston"],"repository":{"type":"git","url":"git://github.com/medikoo/log.git"},"dependencies":{"d":"1","es5-ext":"^0.10.46","event-emitter":"^0.3.5"},"devDependencies":{"browserstack-tape-runner":"2","cjs-module":"1.4","eslint":"^5.6","eslint-config-medikoo-es5":"^1.7.1","istanbul":"^0.4.5","tape":"^4.9.1","tape-index":"2"},"eslintConfig":{"extends":"medikoo-es5","root":true},"scripts":{"coverage":"tape-index && istanbul cover test.index.js","check-coverage":"npm run coverage && istanbul check-coverage --statements 100 --function 100 --branches 100 --lines 100","lint":"eslint --ignore-path=.gitignore .","test":"tape-index && node test.index.js","test-browsers":"tape-index && browserstack-tape-runner test.index.js"},"browserstack":{"browsers":["chrome_current","firefox_current","safari_current","opera_current","ie_11","edge_current"]},"license":"ISC","gitHead":"41e4dc8fe4aa793fabfe30cbb114513eb80f8798","bugs":{"url":"https://github.com/medikoo/log/issues"},"homepage":"https://github.com/medikoo/log#readme","_id":"log@3.2.0","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"dist":{"integrity":"sha512-JDRv2YAFsBXRiYdgqbFyHgNtvr+ezLLjxG83imXJblxerzvPNWbF2DCQfKu/5M1DU9bcmDl/WMSc87RRe6y1NA==","shasum":"347bd93fe96edd26653609438db0843e02da6ac5","tarball":"http://registry-npm.ywwl.com/log/download/log-3.2.0.tgz","fileCount":24,"unpackedSize":43576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/6qfCRA9TVsSAnZWagAAO0EP/3SL/TiIweEaPWij7K3P\n5ywi9T2eqDpnRQV8eAtroAwkfKjLKpUa0gVovWUUjrx+8VVxqxWcqvlpAKWB\no4Qn+LokDpYCavBCADIbhvRaThsJYQyukXoS3ExrQ/hTFUTuK88gvkIYSzrZ\npFOCYQ5wpAmkh/yGInj/u3Cz1TgJIFO9reQ1NzcKZLqImKc3PEzFQOGnehK5\n/XkuNiqwltHvGaj6MkcKHYhIsCaN3tfAe9cm5Mb2T3aHzQryQF/4nSA840/q\n9mCHwgYZoJNEPuof0xQD5o4J5PIll29ifoDnE9Du1Wl2gl+1SM52wOyM8aVJ\nujE5i3WOjZbvnUkgDRrYTG1FHu2qhegvNJC2Xlsqt7v8S/drM5RTJoMdEEa/\nbPf308vLIDD4uKIuBtUrzb1quRGFj+LV9HJYAoA6YF12egl7nmXLVcHVcbOi\nCx3tEURET5aWKrxuS/d/2b0Y2DQw82Pjcnul9RNaaXqx6NbHfck3O/DSesVJ\nLNAOMW8Xs19vhBKBsQcKlf0hrqppi+lTX5MWV1IaMZvs122OrfHtKuabwkUy\ng+ZhLX5Epfiq32lBUjpUwM3i3YGo86gACEAx3WX2zSCHjkwjspW0w3OMvk/w\n68edWyDPnUJ5c4tniyfzGVoJiretCuf6Zqr9BScBgfuMbr2hdi9ZXYZtVkjo\ngUuI\r\n=cFmY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9bQrMs3TMpnK3YMhkoycwGBiASNBqlS1epSofOW4nZAiEAoLEX6PCe8v4qRxGv7BWeyB8jyLKuGRsUuTOpRb2cjfw="}],"size":12229,"noattachment":false,"key":"/log/-/log-3.2.0.tgz"},"maintainers":[{"email":"medikoo+npm@medikoo.com","name":"medikoo"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/log_3.2.0_1543482014998_0.5434292228511253"},"_hasShrinkwrap":false,"readme":"[![Build status][build-image]][build-url]\n[![Tests coverage][cov-image]][cov-url]\n[![npm version][npm-image]][npm-url]\n\n# log\n\n## Universal logging utility\n\n**Configurable, environment and presentation agnostic, with log levels and namespacing ([debug](https://github.com/visionmedia/debug#debug) style) support**\n\n### Usage\n\n#### 1. Write application/library logs\n\n```javascript\n// Default logger (writes at 'info' level)\nconst log = require(\"log\");\n\n// Log 'info' level message:\nlog.info(\"some info message %s\", \"injected string\");\n\n// Get namespaced logger (debug lib style)\nconst myLibLog = log.get(\"my-lib\");\n\n// Log 'info' level message in context of 'my-lib' namespace:\nmyLibLog.info(\"some info message in 'my-lib' namespace context\");\n\n// Namespaces can be further nested\nconst myLibFuncLog = log.get(\"func\");\n\n// Log 'info' level message in context of 'my-lib:func' namespace:\nmyLibFuncLog.info(\"some info message in 'my-lib:func' namespace context\");\n\n// Log 'error' level message in context of 'my-lib:func' namespace:\nmyLibFuncLog.error(\"some error message\");\n\n// log output can be dynamically enabled/disabled during runtime\nconst { restore } = myLibFuncLog.error.disable();\nmyLibFuncLog.error(\"error message not really logged\");\n// Restore previous logs visibiity state\nrestore();\nmyLibFuncLog.error(\"error message to be logged\");\n```\n\n#### 2. Initialize log writer in main (starting) process module\n\ne.g. if target is Node.js, then install `log-node`, and at the top of main module initialize it\n\n```javascript\nrequire(\"log-node\")();\n```\n\n### Available log levels\n\nMirror of applicable syslog levels (in severity order):\n\n- `debug` - debugging information (hidden by default)\n- `info` - a purely informational message (hidden by default)\n- `notice` - condition normal, but significant\n- `warning` (also aliased as `warn`) - condition warning\n- `error` - condition error - to notify of errors accompanied with recovery mechanism (hence reported as log and not as uncaught exception)\n\n_Note: `critical`, `alert`, `emergency` are not exposed as seem to not serve a use case in context of JS applications,\nsuch errors should be exposed as typical exceptions_\n\n### Output message formatting\n\n`log` doesn't force any specific arguments handling. Still it is recommended to assume [printf-like](https://en.wikipedia.org/wiki/Printf_format_string) message\nformat, as all currently available writers are setup to support it. Placeholders support reflects one implemented in Node.js [format](https://nodejs.org/api/util.html#util_util_format_format_args) util\n\nExcerpt from Node.js documentation:\n\n_The first argument is a string containing zero or more placeholder tokens. Each placeholder token is replaced with the converted value from the corresponding argument. Supported placeholders are:_\n\n- _`%s` - String._\n- _`%d` - Number (integer or floating point value)._\n- _`%i` - Integer._\n- _`%f` - Floating point value._\n- _`%j` - JSON. Replaced with the string '[Circular]' if the argument contains circular references._\n- _`%o` - Object. A string representation of an object with generic JavaScript object formatting. Similar to util.inspect() with options { showHidden: true, depth: 4, showProxy: true }. This will show the full object including non-enumerable symbols and properties._\n- _`%O` - Object. A string representation of an object with generic JavaScript object formatting. Similar to util.inspect() without options. This will show the full object not including non-enumerable symbols and properties._\n- _`%%` - single percent sign ('%'). This does not consume an argument._\n\n_Note to log writer configuration developers: For cross-env compatibility it is advised to base implementation on [sprintf-kit](https://github.com/medikoo/sprintf-kit)_\n\n### Enabling log writing\n\n`log` on its own doesn't write anything to the console or any other means (it just emits events to be consumed by preloaded log writers).\n\nTo have logs written, the pre-chosen log writer needs to be initialized in the main (starting) module of a process.\n\n#### List of available log writers\n\n- [`log-node`](https://github.com/medikoo/log-node) - For typical Node.js processes\n- [`log-aws-lambda`](https://github.com/medikoo/log-aws-lambda) - For AWS lambda environment\n\n_Note: if some writer is missing, propose a PR_\n\n### Logs Visibility\n\nDefault visibility depends on the enviroment (see chosen log writer for more information), and in most cases is setup through the following environment variables:\n\n##### `LOG_LEVEL`\n\n(defaults to `notice`) Lowest log level from which (upwards) all logs will be exposed.\n\n##### `LOG_DEBUG`\n\nEventual list of namespaces to expose at levels below `LOG_LEVEL` threshold\n\nList is comma separated as e.g. `foo,-foo:bar` (expose all `foo` but not `foo:bar`).\n\nIt follows convention configured within [debug](https://github.com/visionmedia/debug#windows-note). To ease eventual migration from [debug](https://github.com/visionmedia/debug), configuration fallbacks to `DEBUG` env var if `LOG_DEBUG` is not present.\n\n### Timestamps logging\n\nWhen following env var is set writers are recommended to expose timestamps aside each log message\n\n##### `LOG_TIME`\n\n- `rel` (default) - Logs time elapsed since logger initialization\n- `abs` - Logs absolute time in ISO 8601 format\n\n## Tests\n\n    $ npm test\n\nProject cross-browser compatibility supported by:\n\n<a href=\"https://browserstack.com\"><img src=\"https://bstacksupport.zendesk.com/attachments/token/Pj5uf2x5GU9BvWErqAr51Jh2R/?name=browserstack-logo-600x315.png\" height=\"150\" /></a>\n\n## Security contact information\n\nTo report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-log?utm_source=npm-log&utm_medium=referral&utm_campaign=readme\">Get professional support for d with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n\n[build-image]: https://github.com/medikoo/log/workflows/Integrate/badge.svg\n[build-url]: https://github.com/medikoo/log/actions?query=workflow%3AIntegrate\n[cov-image]: https://img.shields.io/codecov/c/github/medikoo/log.svg\n[cov-url]: https://codecov.io/gh/medikoo/log\n[npm-image]: https://img.shields.io/npm/v/log.svg\n[npm-url]: https://www.npmjs.com/package/log\n","publish_time":1543482015105,"_cnpm_publish_time":1543482015105,"dist-tags":{"latest":"6.3.2"}}