{"name":"@azure/logger","version":"1.0.4-alpha.20220523.1","keywords":["azure","log","logger","logging","node.js","typescript","javascript","browser","cloud"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/logger@1.0.4-alpha.20220523.1","maintainers":[{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"}],"homepage":"https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md","bugs":{"url":"https://github.com/Azure/azure-sdk-for-js/issues"},"dist":{"shasum":"41e18e527448b2d0ec703595fc8ac40d12e6e1ca","tarball":"http://registry-npm.ywwl.com/@azure/logger/download/@azure/logger-1.0.4-alpha.20220523.1.tgz","fileCount":14,"integrity":"sha512-WUIp9kfFMVcZtOh5P/5/o48H99pexkIM1iuHdunLTUkvGWJxH87EbtNqT0UGzyZc4huIcQMJ53i/YNt8/C0XSQ==","signatures":[{"sig":"MEUCIGgObdkatxyLAioM+zgYv3863qQSq9NpPc37LubfYwVBAiEAxWapHAIorUfEiBlJ8ECImS3z1wQDEbvK5a55/oChqtg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55578,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJii885ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoU+A/+IfCHoS8QL6S273grjjJAmIakyQC1+e2RqqwWeLOZvWLZQTsL\r\n+kGb2OkLOkyO13dpyql3qkOYbtETdpmnZavUPK5vzhnKxE25G17nQ3ix1WDx\r\nafKai0KSPhyA9X1nbIQ8zXsbNHhdLp8VB/v4XeEYkQfU01P28ibcBg7ylIJz\r\nR6V3iRpNcFe0zAY+Nm8W9gTur3XBvZmxJqGVPldEnaGTIY8Me/8iaBaRJwXT\r\n4pDKVRPGEY8vhcdZM7ZDt+m/DQmnCXB/PloJOcimNdkSgVgsUulBraOPFhJC\r\nrEn26xxOHpA53xzuKT4ShWoHcDNa5UYBZviP2WjiTK9YK4X+qXbCP1E8jo/w\r\nnW2AAc2uEcOou1O9whv4CS4yjT2UtVq1OGZjI8lX+cQ35G+CruhiuthNgVMy\r\nJl1L/9vGgEkhG3jBYuCfiHrqkX80p/yLXm+wJCl4bd9wuAzmEzQY94oEOIAz\r\nC0Fg8YHJkY6oxD3SAFwM28Nkz1dp+ROGaJuh+SPnnV6132eYKNWSxNnnvGrT\r\nu7fIRWMytDwHN0paCAY4c4QDM1DsCc59OL+VNp5VpjddNFum/lDeIw0YXJno\r\n0+siQPaO6zKGLVAa1geLRTH/jHI4Oicsy9gKiDjWk2ecBCVki9yOjB0HRurl\r\nPaquAqvQFG50sTF/tpDd1ZV0uTSabKpSbps=\r\n=Cb2T\r\n-----END PGP SIGNATURE-----\r\n","size":10913,"noattachment":false,"key":"/@azure/logger/-/@azure/logger-1.0.4-alpha.20220523.1.tgz"},"main":"./dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-logger/azure-logger-1.0.4-alpha.20220523.1.tgz","types":"./types/logger.d.ts","module":"dist-esm/src/index.js","readme":"# Azure Logger client library for JavaScript\n\nThe `@azure/logger` package can be used to enable logging in the Azure SDKs for JavaScript.\n\nLogging can be enabled for the Azure SDK in the following ways:\n\n- Setting the AZURE_LOG_LEVEL environment variable\n- Calling setLogLevel imported from \"@azure/logger\"\n- Calling enable() on specific loggers\n- Using the `DEBUG` environment variable.\n\nNote that AZURE_LOG_LEVEL, if set, takes precedence over DEBUG. Only use DEBUG without specifying AZURE_LOG_LEVEL or calling setLogLevel.\n\n## Getting started\n\n### Installation\n\nInstall this library using npm as follows\n\n```\nnpm install @azure/logger\n```\n\n## Key Concepts\n\nThe `@azure/logger` package supports the following log levels\nspecified in order of most verbose to least verbose:\n\n- verbose\n- info\n- warning\n- error\n\nWhen setting a log level, either programmatically or via the `AZURE_LOG_LEVEL` environment variable,\nany logs that are written using a log level equal to or less than the one you choose\nwill be emitted.\n\nFor example, setting the log level to `warning` will cause all logs that have the log\nlevel `warning` or `error` to be emitted.\n\n## Examples\n\n### Example 1 - basic usage\n\n```js\nconst { EventHubClient } = require('@azure/event-hubs');\n\nconst logger = require('@azure/logger');\nlogger.setLogLevel('info');\n\n// operations will now emit info, warning, and error logs\nconst client = new EventHubClient(/* params */);\nclient.getPartitionIds()\n  .then(ids => { /* do work */ })\n  .catch(e => { /* do work */ });\n});\n```\n\n### Example 2 - redirect log output\n\n```js\nconst { AzureLogger, setLogLevel } = require(\"@azure/logger\");\n\nsetLogLevel(\"verbose\");\n\n// override logging to output to console.log (default location is stderr)\nAzureLogger.log = (...args) => {\n  console.log(...args);\n};\n```\n\nUsing `AzureLogger`, it is possible to redirect the logging output from the Azure SDKs by\noverriding the `AzureLogger.log` method. This may be useful if you want to redirect logs to\na location other than stderr.\n\n## Next steps\n\nYou can build and run the tests locally by executing `rushx test`. Explore the `test` folder to see advanced usage and behavior of the public classes.\n\n## Troubleshooting\n\nIf you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).\n\n## Contributing\n\nIf you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.\n\n![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Flogger%2FREADME.png)\n","browser":{"process":false,"./dist-esm/src/log.js":"./dist-esm/src/log.browser.js"},"engines":{"node":">=12.0.0"},"scripts":{"lint":"eslint package.json api-extractor.json src test --ext .ts","pack":"npm pack 2>&1","test":"npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test","audit":"node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit","build":"npm run clean && tsc -p . && dev-tool run bundle && api-extractor run --local --local","clean":"rimraf dist dist-* temp types *.tgz *.log","format":"prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","pretest":"npm run build:test","lint:fix":"eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]","test:node":"npm run clean && tsc -p . && npm run unit-test:node && npm run integration-test:node","unit-test":"npm run unit-test:node && npm run unit-test:browser","build:test":"tsc -p . && dev-tool run bundle","extract-api":"tsc -p . && api-extractor run --local","check-format":"prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"","test:browser":"npm run clean && npm run build:test && npm run unit-test:browser && npm run integration-test:browser","build:samples":"echo Obsolete","unit-test:node":"mocha -r esm -r ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace  --exclude \"test/**/browser/*.spec.ts\" \"test/**/*.spec.ts\"","execute:samples":"echo skipped","integration-test":"npm run integration-test:node && npm run integration-test:browser","unit-test:browser":"karma start --single-run","integration-test:node":"echo skipped","integration-test:browser":"echo skipped"},"_npmUser":{"name":"azure-sdk","email":"azure-sdk-npmjs@microsoft.com"},"sdk-type":"client","_resolved":"/mnt/vss/_work/1/packages/azure-logger/azure-logger-1.0.4-alpha.20220523.1.tgz","_integrity":"sha512-WUIp9kfFMVcZtOh5P/5/o48H99pexkIM1iuHdunLTUkvGWJxH87EbtNqT0UGzyZc4huIcQMJ53i/YNt8/C0XSQ==","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"8.5.5","description":"Microsoft Azure SDK for JavaScript - Logger","directories":{},"sideEffects":false,"_nodeVersion":"16.15.0","dependencies":{"tslib":"^2.2.0"},"react-native":{"./dist/index.js":"./dist-esm/src/index.js"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^15.0.0","chai":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","dotenv":"^8.2.0","eslint":"^8.0.0","rimraf":"^3.0.0","ts-node":"^10.0.0","prettier":"^2.5.1","cross-env":"^7.0.2","puppeteer":"^14.0.0","typescript":"~4.6.0","@types/chai":"^4.1.6","@types/node":"^12.0.0","karma-mocha":"^2.0.1","@types/mocha":"^7.0.2","@types/sinon":"^9.0.4","karma-coverage":"^2.0.0","@azure/dev-tool":">=1.0.0-alpha <1.0.0-alphb","karma-ie-launcher":"^1.0.0","karma-edge-launcher":"^0.4.2","karma-junit-reporter":"^2.0.1","karma-mocha-reporter":"^2.2.5","mocha-junit-reporter":"^2.0.0","karma-chrome-launcher":"^3.0.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-sourcemap-loader":"^0.3.8","@microsoft/api-extractor":"7.18.11","@azure/eslint-plugin-azure-sdk":">=3.0.0-alpha <3.0.0-alphb"},"_npmOperationalInternal":{"tmp":"tmp/logger_1.0.4-alpha.20220523.1_1653329721371_0.5683725057780469","host":"s3://npm-registry-packages"},"publish_time":1653329721605,"_cnpm_publish_time":1653329721605,"dist-tags":{"dev":"1.3.1-alpha.20260306.4","latest":"1.4.0"}}