{"name":"log","version":"5.1.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.0.0","duration":"^0.2.2","es5-ext":"^0.10.49","event-emitter":"^0.3.5","sprintf-kit":"^2.0.0","type":"^1.0.0"},"devDependencies":{"browserstack-tape-runner":"^3.0.0","eslint":"^5.16.0","eslint-config-medikoo-es5":"^2.0.0","essentials":"^1.0.0","git-list-updated":"^1.1.2","husky":"^1.3.1","lint-staged":"^8.1.5","ncjsm":"^2.0.1","nyc":"^13.3.0","prettier-elastic":"^1.16.4","tape":"^4.10.1","tape-index":"^3.1.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["eslint"],"*.{css,html,js,json,md,yaml,yml}":["prettier -c"]},"eslintConfig":{"extends":"medikoo-es5","root":true,"overrides":[{"files":"lib/printf-modifiers.js","rules":{"id-length":"off"}},{"files":"test/lib/printf-modifiers.js","rules":{"new-cap":"off"}}]},"scripts":{"coverage":"nyc --reporter=lcov --reporter=html --reporter=text-summary npm test","check-coverage":"npm run coverage && nyc check-coverage --statements 100 --function 100 --branches 100 --lines 100","lint":"eslint --ignore-path=.gitignore .","lint-updated":"pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'","prettier-check-updated":"pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c","prettify":"prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'","test":"npm run test-prepare && npm run test-run","test-browsers":"tape-index && browserstack-tape-runner test.index.js","test-prepare":"tape-index","test-run":"node test.index.js"},"browserstack":{"browsers":["chrome_current","firefox_current","safari_current","opera_current","ie_11","edge_current"]},"license":"ISC","gitHead":"c0ac26c35c3138a66085a2b73ba052d1d1c770af","bugs":{"url":"https://github.com/medikoo/log/issues"},"homepage":"https://github.com/medikoo/log#readme","_id":"log@5.1.0","_nodeVersion":"11.13.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-pXdS4zsaC0FP5SGFtR1KTPiBvbg+qi7Ke2DMFi/TrUxf6417OjpD0DG2BXFfLLi7+luxjLAJrDOj8Q+elNSDmA==","shasum":"f3d30d97447c118139c26a42e4ee913a62fecbc3","tarball":"http://registry-npm.ywwl.com/log/download/log-5.1.0.tgz","fileCount":42,"unpackedSize":57716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcq1Q0CRA9TVsSAnZWagAAVZ0P/1KzmOAT4LepuKk8e+Om\nZ6sVOolah/YBOTQ2dIErMh7oNTN/gInJ6zxXZGko0xSRTk1FxXTK+qZS5rWq\n8uROqGQ2CCDw5QV4Pv09QMsvz9OSU+i5PxfnE7hcRKAaTouyHW3ddl7/18lG\n/afSWMzSjFlSF+5z4c5at6aQBSRtyZ2GBOGCoMXmGwN3PJlu8oKx0URGMvZK\n1m51dbfsF65aVyv+3V7xjB/9QbFdV/TxdttC4zsC96o59FcQ74rRM127lZ9m\n4Ld8V5f1gbDHto5PNM2W8PMqDMwrLK6F+KWdQqhMAbhbDNcWU9aKexsBtX5j\nShcojiJC4p28Qlk4/x0B2pf8i9NV7+xXvogqm6e25EF+Qyd+fHHP+qPCxg9Z\nc53692b7ISUVmBk4GpkOcTA+osBlbxNtrFB9srbfeyrnxtAY31iU/Hr1WIWv\n0myA4W0sLBUHGDtQcXAbKPfDn0AJCGwMkxRupyfM1uemEqwMDSX96o7TGcmb\naM5NcOEa2T81VhiAiRum7/3C1mlsAhylCZl/lxwWAgKCLL8hN4AT0L+XQlvr\nUpvb/p+wrwJjcknc7//uIgxesXT4NX/D/7CosIDNzRQQUtztQGVRGznyv2Qm\nSO1R/imISautxGuAMzpKmi9xXymm6vubmibt6Ut+tlUQI2DCu2ZH94t1AiLr\nfSO0\r\n=Qoux\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHrLxFBcQcvxv7kaG/AoeqH0QZXzCfpooj0/WSLrjN6wIgSB+p3l33+t4qORkEOU7HTAzxj71+txBqaFwE6uJiMW8="}],"size":15893,"noattachment":false,"key":"/log/-/log-5.1.0.tgz"},"maintainers":[{"email":"medikoo+npm@medikoo.com","name":"medikoo"}],"_npmUser":{"name":"medikoo","email":"medikoo+npm@medikoo.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/log_5.1.0_1554732083282_0.2523176258669815"},"_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":1554732083429,"_cnpm_publish_time":1554732083429,"dist-tags":{"latest":"6.3.2"}}