{"name":"@libp2p/logger","version":"2.1.1-05abd49f","keywords":["IPFS"],"license":"Apache-2.0 OR MIT","_id":"@libp2p/logger@2.1.1-05abd49f","homepage":"https://github.com/libp2p/js-libp2p/tree/master/packages/logger#readme","bugs":{"url":"https://github.com/libp2p/js-libp2p/issues"},"dist":{"shasum":"c4d4d7c6e55c4fa7bd3c9d6634e1d8123749c237","tarball":"http://registry-npm.ywwl.com/@libp2p/logger/download/@libp2p/logger-2.1.1-05abd49f.tgz","fileCount":9,"integrity":"sha512-kmJg7yBT/6X09W7rM76+aLUeauaSwqfktWajXRBZCHYadXjZBnWJ7f/m1wSZ54NSXXAH69Y3E4W0WEQf3jfjEw==","signatures":[{"sig":"MEUCIQC5usYk+hMWQ5xKr201u+6k+XNywQv+kHB6UJNCO3KNqgIgJHqQN+yG5DL/9i1y1fEg/JDtr0LaNCvYtLDdTbZeZ4I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26469,"size":8760,"noattachment":false,"key":"/@libp2p/logger/-/@libp2p/logger-2.1.1-05abd49f.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"05abd49ff419f862238b3ed9c1fc6422389b250a","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"},"typedoc":{"entryPoint":"./src/index.ts"},"_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":"8.19.4","description":"A logging component for use in js-libp2p modules","directories":{},"_nodeVersion":"18.16.0","dependencies":{"debug":"^4.3.4","multiformats":"^12.0.1","@libp2p/interface":"0.0.1-05abd49f","interface-datastore":"^8.2.0","@multiformats/multiaddr":"^12.1.3"},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"aegir":"^39.0.10","sinon":"^15.1.2","uint8arrays":"^4.0.3","@types/debug":"^4.1.7","@libp2p/peer-id":"2.0.3-05abd49f"},"_npmOperationalInternal":{"tmp":"tmp/logger_2.1.1-05abd49f_1687403272885_0.19781925543277912","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":1687403273137,"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":1687403273137,"dist-tags":{"latest":"6.2.16","next":"6.2.16-fab409544"}}