{"name":"@azure/logger","version":"1.0.3-alpha.20210930.2","keywords":["azure","log","logger","logging","node.js","typescript","javascript","browser","cloud"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/logger@1.0.3-alpha.20210930.2","maintainers":[{"name":"southpolesteve","email":"southpolesteve@gmail.com"},{"name":"christopheranderson","email":"chrande@outlook.com"},{"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":"bb3bb6d93a08c20145284ca78aa849ccfd6aa85f","tarball":"http://registry-npm.ywwl.com/@azure/logger/download/@azure/logger-1.0.3-alpha.20210930.2.tgz","fileCount":15,"integrity":"sha512-AsCDlneOucqG82yehXTx3T2CheCF5s4oG7vAgqG73knIKfBm17A0bhcRw0vl5wvv4eVeWyI091XsJ2fIydNYFw==","signatures":[{"sig":"MEQCIHYR1Nj8om7IcoP4gxOKnb+3b87omlsuUmMoG77YsQ1yAiBe/NZM4CxXCnvd+9rcGBG7tVzqyyD+XGHKdP+1DwqYsg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":56027,"size":10841,"noattachment":false,"key":"/@azure/logger/-/@azure/logger-1.0.3-alpha.20210930.2.tgz"},"main":"./dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-logger/azure-logger-1.0.3-alpha.20210930.2.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":{"docs":"typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src","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 && rollup -c 2>&1 && 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 . && rollup -c 2>&1 && 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\" \"samples-dev/**/*.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 . && rollup -c 2>&1","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":"","_integrity":"","repository":{"url":"git+https://github.com/Azure/azure-sdk-for-js.git","type":"git"},"_npmVersion":"6.14.15","description":"Microsoft Azure SDK for JavaScript - Logger","directories":{},"sideEffects":false,"_nodeVersion":"14.18.0","dependencies":{"tslib":"^2.2.0"},"react-native":{"./dist/index.js":"./dist-esm/src/index.js"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.0.0","chai":"^4.2.0","delay":"^4.2.0","karma":"^6.2.0","mocha":"^7.1.1","sinon":"^9.0.2","dotenv":"^8.2.0","eslint":"^7.15.0","rimraf":"^3.0.0","rollup":"^1.16.3","ts-node":"^10.0.0","typedoc":"0.15.2","prettier":"^1.16.4","cross-env":"^7.0.2","puppeteer":"^10.2.0","typescript":"~4.2.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":"^1.18.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.3-alpha.20210930.2_1633025547147_0.5692651664848818","host":"s3://npm-registry-packages"},"publish_time":1633025547334,"_cnpm_publish_time":1633025547334,"dist-tags":{"dev":"1.3.1-alpha.20260306.4","latest":"1.4.0"}}