{"name":"@libp2p/logger","version":"3.0.2-e9099d40","keywords":["IPFS"],"license":"Apache-2.0 OR MIT","_id":"@libp2p/logger@3.0.2-e9099d40","homepage":"https://github.com/libp2p/js-libp2p/tree/master/packages/logger#readme","bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"dist":{"shasum":"74f8da66422e8acd13ea528915745f952661ac1c","tarball":"http://registry-npm.ywwl.com/@libp2p/logger/download/@libp2p/logger-3.0.2-e9099d40.tgz","fileCount":9,"integrity":"sha512-GnM7KUGsaIbYv9ahQsvdYCPfnfyo969si0nqJ1gCiG0t1t99cwHZNRzc027dK3pcLyuLPCNqtSjVvpzBEnBkRQ==","signatures":[{"sig":"MEQCIGe8hh90OXpYDM9KYqcladreK3mxQQBVxPjfcd1d8CLtAiBQ2k7BgvBHM2Cnj3siLhvlMdQx7Y3fDMyjRSgkWZKDgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26436,"size":8749,"noattachment":false,"key":"/@libp2p/logger/-/@libp2p/logger-3.0.2-e9099d40.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"e9099d405b205b741fcd0958569bfb06d6211e65","scripts":{"lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","dep-check":"aegir dep-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@protocol.ai"},"repository":{"url":"git+https://github.com/libp2p/js-libp2p.git","type":"git"},"_npmVersion":"9.8.1","description":"A logging component for use in js-libp2p modules","directories":{},"_nodeVersion":"18.18.0","dependencies":{"debug":"^4.3.4","multiformats":"^12.0.1","@libp2p/interface":"0.1.2-e9099d40","interface-datastore":"^8.2.0","@multiformats/multiaddr":"^12.1.5"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"aegir":"^40.0.8","sinon":"^16.0.0","uint8arrays":"^4.0.4","@types/debug":"^4.1.7","@libp2p/peer-id":"3.0.2-e9099d40"},"_npmOperationalInternal":{"tmp":"tmp/logger_3.0.2-e9099d40_1696551577100_0.6196639515896389","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":1696551577338,"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":1696551577338,"dist-tags":{"latest":"6.2.16","next":"6.2.16-fab409544"}}