{"name":"@azure/logger","version":"1.0.3-alpha.20210913.3","keywords":["azure","log","logger","logging","node.js","typescript","javascript","browser","cloud"],"author":{"name":"Microsoft Corporation"},"license":"MIT","_id":"@azure/logger@1.0.3-alpha.20210913.3","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":"e36469972123078d0bc32743a6eaf1b932d0f2d2","tarball":"http://registry-npm.ywwl.com/@azure/logger/download/@azure/logger-1.0.3-alpha.20210913.3.tgz","fileCount":15,"integrity":"sha512-Ei395ughdcSggFlx5j2uiNTSObBDPJcblapTNBDISmpOIKpalEU4dzCaCeBtp7/hEH0tR+vK5WawGrYDjV+YeQ==","signatures":[{"sig":"MEUCICInmnVqqpQly80n3v3nxrhHjaRNd0CIlsu6TF5Gy0AgAiEArwTmpFwAM5uGZ+ONH/UUXlIRfq2GGfcw4frOKAtfcWs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":55811,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhP5WkCRA9TVsSAnZWagAAs6YP/jZ3XBC3sag/0qVAYFJz\nVHqzX0zh4SZrn6b9jzr6h2rSYEfyhu3crAUNIGGMWBqV/p7ntFQxHT0FWtCS\neY9+Bx1Vtr2+GSChneWnJTHMDpJBE9dit0ZSjgZK678fnNAGdfmElHastnTv\nlO3Ani/wUEpvMp0/4scEqHgQ2c6fFTcFzLfYnO1y1fu1U8eL8WEHB14p/eDE\nm8C58T8Y9zX+M6GTJeQgd01vJoGJJhibLYgY0kV2ngAXSmsem3gRDVQBheYE\nYmN41Zn2CzcCUW9n++/B9LDJ8fqhjySfQSD3Z/oPpd726gzb3HgoPm/YbVcw\nmLh6c9B5fcSQ/yvv0IWEldihGD7AGfXjl5bqXbASjtZPRxSqM2k3yApmjX8t\njv+/rj4SMNYOExM09gmm5p/8oom9G881+5rtQ2/80Gn2upHwfdfCRNzTf1WF\ncKrPazhH83xRaqUDz6XXjPoh9g2/5q4OvHgHXRnaxplIEfb79UXkLT2g7/P8\nBRIis6UZN232R+GeGkut4vXdpfFX4nTwiJyypR3vY+YlpM1o+TL4mL+L4wYx\ncdLn/7qzfC9boJGRH/yiPsBPRRRcCDaGthJdO1hn9ppV28KL0Z02awtC99b0\n/vVxANp1c4xD9m2gVSw2I2MgXHpexfZLE5KcZe6umH81i3MBO9EGMiTTESYh\nWE2/\r\n=+YDN\r\n-----END PGP SIGNATURE-----\r\n","size":10779,"noattachment":false,"key":"/@azure/logger/-/@azure/logger-1.0.3-alpha.20210913.3.tgz"},"main":"./dist/index.js","_from":"file:/mnt/vss/_work/1/packages/azure-logger/azure-logger-1.0.3-alpha.20210913.3.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.17.6","dependencies":{"tslib":"^2.2.0"},"_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.7.11","@azure/eslint-plugin-azure-sdk":">=3.0.0-alpha <3.0.0-alphb"},"_npmOperationalInternal":{"tmp":"tmp/logger_1.0.3-alpha.20210913.3_1631557028423_0.440857540286828","host":"s3://npm-registry-packages"},"publish_time":1631557028668,"_cnpm_publish_time":1631557028668,"dist-tags":{"dev":"1.3.1-alpha.20260306.4","latest":"1.4.0"}}