{"name":"@libp2p/logger","version":"4.0.10-c2181f0cf","keywords":["IPFS"],"license":"Apache-2.0 OR MIT","_id":"@libp2p/logger@4.0.10-c2181f0cf","homepage":"https://github.com/libp2p/js-libp2p/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"dist":{"shasum":"f59c12ed714b2a71eae6fe6088b2f515a3a7f1e3","tarball":"http://registry-npm.ywwl.com/@libp2p/logger/download/@libp2p/logger-4.0.10-c2181f0cf.tgz","fileCount":14,"integrity":"sha512-ZGlPBgS7kZZ+EoxhLZRrUIX7Ysc400ay1DtQP3RilZlM++5ubMitoAw9/7uLGJSJh27OCua+u9WEqjrNzgZF9w==","signatures":[{"sig":"MEUCIFbo1EqrpZiYwcf6AyNvAeiV/X6lhYuQKaRAfs9T3A90AiEA3hsTJZEWPgZ5YWGSMszHrGjppAkw/kqDhhpyg1KdzqU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@libp2p%2flogger@4.0.10-c2181f0cf","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":38436,"size":11256,"noattachment":false,"key":"/@libp2p/logger/-/@libp2p/logger-4.0.10-c2181f0cf.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"c2181f0cf11c2c74fff08ea9197af25528a02e6d","scripts":{"lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","dep-check":"aegir dep-check","doc-check":"aegir doc-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","test:electron-main":"aegir test -t electron-main","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"npm-service-account-libp2p","email":"npm-service-account+libp2p@ipfs.tech"},"repository":{"url":"git+https://github.com/libp2p/js-libp2p.git","type":"git"},"_npmVersion":"10.5.2","description":"A logging component for use in js-libp2p modules","directories":{},"sideEffects":false,"_nodeVersion":"20.12.2","dependencies":{"debug":"^4.3.4","multiformats":"^13.1.0","@libp2p/interface":"1.2.0-c2181f0cf","interface-datastore":"^8.2.11","@multiformats/multiaddr":"^12.2.1"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"aegir":"^42.2.5","sinon":"^17.0.1","uint8arrays":"^5.0.3","@types/debug":"^4.1.12","@libp2p/peer-id":"4.0.10-c2181f0cf"},"_npmOperationalInternal":{"tmp":"tmp/logger_4.0.10-c2181f0cf_1713964450593_0.5244026615902899","host":"s3://npm-registry-packages"},"readme":"# @libp2p/logger\n\n[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)\n[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)\n[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=main\\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amain)\n\n> A logging component for use in js-libp2p modules\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nA logger for libp2p based on the venerable [debug](https://www.npmjs.com/package/debug) module.\n\n## Example\n\n```TypeScript\nimport { logger } from '@libp2p/logger'\n\nconst log = logger('libp2p:my:component:name')\n\ntry {\n  // an operation\n  log('something happened: %s', 'it was ok')\n} catch (err) {\n  log.error('something bad happened: %o', err)\n}\n\nlog('with this peer: %p', {})\nlog('and this base58btc: %b', Uint8Array.from([0, 1, 2, 3]))\nlog('and this base32: %t', Uint8Array.from([4, 5, 6, 7]))\n```\n\n```console\n$ DEBUG=libp2p:* node index.js\nsomething happened: it was ok\nsomething bad happened: <stack trace>\nwith this peer: 12D3Foo\nwith this base58btc: Qmfoo\nwith this base32: bafyfoo\n```\n\n# Install\n\n```console\n$ npm i @libp2p/logger\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `Libp2pLogger` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/@libp2p/logger/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://libp2p.github.io/js-libp2p/modules/_libp2p_logger.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/libp2p/js-libp2p/blob/main/packages/logger/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/libp2p/js-libp2p/blob/main/packages/logger/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","publish_time":1713964450798,"maintainers":[{"name":"jacobheun","email":"jacobheun@gmail.com"},{"name":"npm-service-account-libp2p","email":"npm-service-account+libp2p@ipfs.tech"},{"name":"alanshaw","email":"alan138@gmail.com"},{"name":"vascosantos","email":"santos.vasco10@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"daviddias","email":"mail@daviddias.me"}],"_cnpm_publish_time":1713964450798,"dist-tags":{"latest":"6.2.16","next":"6.2.16-fab409544"}}