@azure/core-amqp
Advanced tools
Comparing version 1.0.0-dev.20200107.1 to 1.0.0-dev.20200108.1
# Release History | ||
## 1.0.0-preview.7 (Unreleased) | ||
## 1.0.0 (2019-01-08) | ||
- This release marks the general availability of the `@azure/core-amqp` package. | ||
- Improved detection of when an established socket is no longer receiving data from the service. | ||
@@ -6,0 +7,0 @@ - Added logging around the network connectivity check. |
@@ -24,3 +24,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
let result; | ||
logger.verbose("[encode] The given message body that needs to be encoded is: ", body); | ||
if (isBuffer(body)) { | ||
@@ -48,3 +47,2 @@ result = message.data_section(body); | ||
} | ||
logger.verbose("[encode] The encoded message body is: %O.", result); | ||
return result; | ||
@@ -63,3 +61,2 @@ } | ||
try { | ||
logger.verbose("[decode] Received message body for decoding is: %O", body); | ||
if (body.content && isBuffer(body.content)) { | ||
@@ -83,3 +80,2 @@ // This indicates that we are getting the AMQP described type. Let us try decoding it. | ||
} | ||
logger.verbose("[decode] The decoded message body is: %O", processedBody); | ||
return processedBody; | ||
@@ -86,0 +82,0 @@ } |
{ | ||
"name": "@azure/core-amqp", | ||
"sdk-type": "client", | ||
"version": "1.0.0-dev.20200107.1", | ||
"version": "1.0.0-dev.20200108.1", | ||
"description": "Common library for amqp based azure sdks like @azure/event-hubs.", | ||
@@ -82,2 +82,3 @@ "author": "Microsoft Corporation", | ||
"@rollup/plugin-json": "^4.0.0", | ||
"@rollup/plugin-multi-entry": "^3.0.0", | ||
"@rollup/plugin-replace": "^2.2.0", | ||
@@ -116,3 +117,2 @@ "@types/chai": "^4.1.6", | ||
"rollup-plugin-inject": "^3.0.0", | ||
"rollup-plugin-multi-entry": "^2.1.0", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
@@ -119,0 +119,0 @@ "rollup-plugin-node-resolve": "^5.0.2", |
@@ -177,26 +177,53 @@ # Azure Core AMQP client library for AMQP operations | ||
You can set the following environment variable to get the debug logs. | ||
The core-amqp library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, and for sending and receiving events over the [AMQP](http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol. | ||
- Getting debug logs from the Event Hub SDK. | ||
### Enable logs | ||
You can set the `AZURE_LOG_LEVEL` environment variable to one of the following values to enable logging to `stderr`: | ||
- verbose | ||
- info | ||
- warning | ||
- error | ||
You can also set the log level programatically by importing the | ||
[@azure/logger](https://www.npmjs.com/package/@azure/logger) package and calling the | ||
`setLogLevel` function with one of the log level values. | ||
For example, when you set the log level to `info`, the logs that are written for levels | ||
`warning` and `error` are also emitted. | ||
This SDK follows the Azure SDK for TypeScript [guidelines](https://azure.github.io/azure-sdk/typescript_implementation.html#general-logging) | ||
when determining which level to log to. | ||
When setting a log level either programatically or via the `AZURE_LOG_LEVEL` environment variable, | ||
any logs that are written using a log level equal to or less than the one you choose will be emitted. | ||
You can alternatively set the `DEBUG` environment variable to get logs when using this library. | ||
This can be useful if you also want to emit logs from the dependencies `rhea-promise` and `rhea` as well. | ||
**Note:** AZURE_LOG_LEVEL, if set, takes precedence over DEBUG. | ||
Do not specify any `azure` libraries via DEBUG when also specifying | ||
AZURE_LOG_LEVEL or calling setLogLevel. | ||
- Getting only info level debug logs from the core-amqp library. | ||
```bash | ||
export DEBUG=azure:core-amqp* | ||
export DEBUG=azure:core-amqp:info | ||
``` | ||
- Getting debug logs from the Event Hub SDK and the protocol level library. | ||
- Getting debug logs from the core-amqp and the protocol level library. | ||
```bash | ||
export DEBUG=azure:core-amqp*,rhea* | ||
export DEBUG=azure:core-amqp:*,rhea* | ||
``` | ||
- If you are **not interested in viewing the message transformation** (which consumes lot of console/disk space) then you can set the `DEBUG` environment variable as follows: | ||
- If you are **not interested in viewing the raw event data** (which consumes a large amount of console/disk space) then you can set the `DEBUG` environment variable as follows: | ||
```bash | ||
export DEBUG=azure:core-amqp*,rhea*,-rhea:raw,-rhea:message,-azure:core-amqp:datatransformer | ||
export DEBUG=azure:core-amqp:*,rhea*,-rhea:raw,-rhea:message | ||
``` | ||
- If you are interested only in **errors**, then you can set the `DEBUG` environment variable as follows: | ||
- If you are interested only in **errors** and SDK **warnings**, then you can set the `DEBUG` environment variable as follows: | ||
```bash | ||
export DEBUG=azure-core-amqp:error,rhea-promise:error,rhea:events,rhea:frames,rhea:io,rhea:flow | ||
export DEBUG=azure:core-amqp:(error|warning),rhea-promise:error,rhea:events,rhea:frames,rhea:io,rhea:flow | ||
``` | ||
@@ -217,3 +244,3 @@ | ||
```bash | ||
node your-test-script.js &> out.log | ||
node your-test-script.js &> out.log | ||
``` | ||
@@ -235,3 +262,3 @@ | ||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/tree/1278511d2aecc4567cf9214e0fac90d3f7e9a03e/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/tree/0cf696e82d8b8f9d857cd728b23a7293f630473e/CONTRIBUTING.md) to learn more about how to build and test the code. | ||
@@ -242,3 +269,2 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). | ||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fcore%2Fcore-amqp%2FREADME.png) |
@@ -45,3 +45,2 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
let result: any; | ||
logger.verbose("[encode] The given message body that needs to be encoded is: ", body); | ||
if (isBuffer(body)) { | ||
@@ -67,3 +66,2 @@ result = message.data_section(body); | ||
} | ||
logger.verbose("[encode] The encoded message body is: %O.", result); | ||
return result; | ||
@@ -83,3 +81,2 @@ } | ||
try { | ||
logger.verbose("[decode] Received message body for decoding is: %O", body); | ||
if (body.content && isBuffer(body.content)) { | ||
@@ -107,5 +104,4 @@ // This indicates that we are getting the AMQP described type. Let us try decoding it. | ||
} | ||
logger.verbose("[decode] The decoded message body is: %O", processedBody); | ||
return processedBody; | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
267
2240738
22443