{"name":"log","version":"4.0.1","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"},"devDependencies":{"browserstack-tape-runner":"^3.0.0","eslint":"^5.15.2","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.0.1"},"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},"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":"e7382804ceba79b41593945b6074eb4d721bdbcd","bugs":{"url":"https://github.com/medikoo/log/issues"},"homepage":"https://github.com/medikoo/log#readme","_id":"log@4.0.1","_nodeVersion":"11.12.0","_npmVersion":"6.7.0","dist":{"integrity":"sha512-zKJ6IBxC3rK5PzwcAOdd3ONw/LABlNHp9uE34wFkgNtKnywFxEcWdVzpRC9ULwg0wN/HgOR3mLwiwWbkSDVaug==","shasum":"5dc01187ababc3e5da0da51edaa557367b9500ac","tarball":"http://registry-npm.ywwl.com/log/download/log-4.0.1.tgz","fileCount":36,"unpackedSize":48208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj5xCCRA9TVsSAnZWagAAN10P/ixiiFVnUEGTIEpAVXVy\nXwktdPwwl4mh7MxPemdjohUYA0LJ33hYeehrLONfgD2VtNP6h4KfVYqQ2qbM\nVJhpGGLWM19fxes44a5uJuuExOcyMPEWUxQS34LXYYjQ80J4GGcIiitAqCeW\nue3sByyBM8fwZ1Acef3kkh4bvZ/ysOpiukCmvaFapjrIRw59ewO3nZDCRvNh\nS5h5Xtc51ErRbxPcCO7i1Imnk5s/nR1so/NpVFSA5WsKMRle5HV8YmKKfKto\nF7y0Dl6LzpTi78a5JqEK+slWEmX7ccPWm+Y6dbpf899Jm10PmN5cPmNQWI4a\ntKlV085NBpa6p1AyiyQjVqxte5CDk1DRKEPLGtHP8V1EiW5TkTBBUtAlZNqa\nApX8PNGsUOvgry7fJiE9j/nxZ5dq27dR/Juu31X9eymfFIGsiTkinIn6DwN/\nALfYlfNSbHQPpzMkOlH16S743b26c/ip4rb1TdJgyTy8oGwEkCxA92n7Llyb\nDnSN6iBLhJt7h0XKIc15xkVODtcVftyrutp5P9gxbeQBPMsHdTiUMlP4zTNI\nuFmCD5zxEgY4Jps+xvyJQhGiIp5aSVHi6a2EIGOGlnMYjo/DSDx4pTJ6oeBm\naKq4nPgcVpAG7B34VhM7Up0bmuWqEz/QX17W9JBdTneWX6ioG05fx+U5o5Dh\nkj2l\r\n=YcdH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvgZxl7X2SRec/NDBBUt+n91yX1Gk1zfYR5SNXDNV5VQIgUSE+a+iLs+3+jhSi9fCY0YWUzSc/oiVPqv+zWyNPpTk="}],"size":13619,"noattachment":false,"key":"/log/-/log-4.0.1.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_4.0.1_1552915521680_0.5600383943228207"},"_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":1552915521868,"_cnpm_publish_time":1552915521868,"dist-tags":{"latest":"6.3.2"}}