{"name":"@libp2p/logger","version":"5.0.0-18dd3cb26","keywords":["IPFS"],"license":"Apache-2.0 OR MIT","_id":"@libp2p/logger@5.0.0-18dd3cb26","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"}],"homepage":"https://github.com/libp2p/js-libp2p/tree/main/packages/logger#readme","bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"dist":{"shasum":"e1193fb0a5c1b7f9d33082d50da4db34aa0aed85","tarball":"http://registry-npm.ywwl.com/@libp2p/logger/download/@libp2p/logger-5.0.0-18dd3cb26.tgz","fileCount":14,"integrity":"sha512-aeT6Uh8tWdewxe+p41leADBLBm0kzuALtKcinMbmKD/mQLC9/GWAqHkmr0KwOYI19hmXPxthZcHT7+i3SIqPKQ==","signatures":[{"sig":"MEYCIQDwkA8rkN4g2qE//qVqAngwdImGuxHhBLHlv3VU2eh/OAIhAL8Pbbjf1Og3rADphn/s4Kxn9rck6Aub7ZNDL67o1Yt2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@libp2p%2flogger@5.0.0-18dd3cb26","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":38174,"size":11199,"noattachment":false,"key":"/@libp2p/logger/-/@libp2p/logger-5.0.0-18dd3cb26.tgz"},"type":"module","types":"./dist/src/index.d.ts","browser":{"./dist/src/debug/node.js":"./dist/src/debug/browser.js"},"exports":{".":{"types":"./src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"18dd3cb2649412126b995c90e976ed06220c8590","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.8.3","description":"A logging component for use in js-libp2p modules","directories":{},"sideEffects":false,"_nodeVersion":"20.17.0","dependencies":{"weald":"^1.0.2","multiformats":"^13.1.0","@libp2p/interface":"2.0.0-18dd3cb26","interface-datastore":"^8.3.0","@multiformats/multiaddr":"^12.2.3"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"react-native":{"./dist/src/debug/node.js":"./dist/src/debug/browser.js"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"aegir":"^44.0.1","sinon":"^18.0.0","uint8arrays":"^5.1.0","@libp2p/peer-id":"5.0.0-18dd3cb26"},"_npmOperationalInternal":{"tmp":"tmp/logger_5.0.0-18dd3cb26_1726132830776_0.5391996540737787","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":1726132830943,"_cnpm_publish_time":1726132830943,"dist-tags":{"latest":"6.2.16","next":"6.2.16-fab409544"}}