Skip to content

Commit

Permalink
[template] Make README Logging section consistent (Azure#14022)
Browse files Browse the repository at this point in the history
* [template] Make README Logging section consistent

We might have introduced the inconsistency for some libraries while copying
content from other languages.

* Update other README files

Contents for messaging libraries (Event Hub/Service Bus) remain unchanges
because they are different in having additional information about `rhea`
logging.

* linking to logger
  • Loading branch information
jeremymeng authored Mar 1, 2021
1 parent f540b4e commit 3738fa3
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 50 deletions.
12 changes: 7 additions & 5 deletions sdk/anomalydetector/ai-anomaly-detector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,18 @@ More Samples can be found [here](https://github.com/Azure/azure-sdk-for-js/tree/

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to see debug logs when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure Anomaly Detector client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export DEBUG=azure*
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

## Next steps

Please take a look at the
Expand Down
12 changes: 7 additions & 5 deletions sdk/attestation/attestation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,18 @@ This SDK provides the following functionality for the Microsoft Azure Attestatio

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to get the debug logging output when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure Attestation client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export AZURE_LOG_LEVEL=verbose
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

## Next steps

## Contributing
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Some of the key features of Azure Core AMQP library are:

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](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol.

### Enable logs
### Logging

You can set the `AZURE_LOG_LEVEL` environment variable to one of the following values to enable logging to `stderr`:

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-lro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ You will be able to find some working examples of an implementation of an operat

## Troubleshooting

### Enable logs
### Logging

Logs can be added at the discretion of the library implementing the Long Running Operation poller.
Packages inside of [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) use
Expand Down
2 changes: 1 addition & 1 deletion sdk/digitaltwins/digital-twins-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ directory for detailed examples on how to use this library.
## Troubleshooting
### Enable logs
### Logging
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
Expand Down
10 changes: 5 additions & 5 deletions sdk/eventgrid/eventgrid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ receiver.subscribe({

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to get the debug logging output when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure Event Grid client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export AZURE_LOG_LEVEL=verbose
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ main();

The Event Hubs library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving events over the [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol.

### Enable logs
### Logging

You can set the `AZURE_LOG_LEVEL` environment variable to enable logging to `stderr`:

Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/eventhubs-checkpointstore-blob/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ main();

## Troubleshooting

### Enable logs
### Logging

You can set the `AZURE_LOG_LEVEL` environment variable to one of the following values to enable logging to `stderr`:

Expand Down
10 changes: 5 additions & 5 deletions sdk/formrecognizer/ai-form-recognizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,14 +435,14 @@ main().catch((err) => {

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to see debug logs when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure Form Recognizer client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export DEBUG=azure*
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
Expand Down
12 changes: 7 additions & 5 deletions sdk/metricsadvisor/ai-metrics-advisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,18 @@ async function queryAnomaliesByAlert(client, alert) {

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to see debug logs when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure MetricsAdvisor client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export DEBUG=azure*
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

## Next steps

Please take a look at the
Expand Down
8 changes: 4 additions & 4 deletions sdk/mixedreality/mixedreality-authentication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,18 @@ documentation for the client library you're using to determine if and how this m

## Troubleshooting

### Enable logs
### Logging

Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and
responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at
runtime by calling `setLogLevel` in the `@azure/logger`:
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

```javascript
import { setLogLevel } from "@azure/logger";

setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

## Next steps

Please take a look at the
Expand Down
10 changes: 5 additions & 5 deletions sdk/search/search-documents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,14 @@ When retrieving results, a `facets` property will be available that will indicat

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to get the debug logs when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure Cognitive Search client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export AZURE_LOG_LEVEL=verbose*
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
Expand Down
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ await serviceBusAdministrationClient.deleteQueue(queueName);

The Service Bus library depends on the [rhea-promise](https://github.com/amqp/rhea-promise) library for managing connections, sending and receiving messages over the [AMQP](https://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-complete-v1.0-os.pdf) protocol.

### Enable logs
### Logging

You can set the following environment variable to get the debug logs when using this library.

Expand Down
12 changes: 7 additions & 5 deletions sdk/template/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@ Create several code examples for how someone would use your library to accomplis

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to see debug logs when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure TextAnalytics client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export DEBUG=azure*
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).

## Next steps

Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/template/template/samples) directory for detailed examples that demonstrate how to use the client libraries.
Expand Down
10 changes: 5 additions & 5 deletions sdk/textanalytics/ai-text-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,14 @@ main();

## Troubleshooting

### Enable logs
### Logging

You can set the following environment variable to get the debug logging output when using this library.
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:

- Getting debug logs from the Azure Text Analytics client library
```javascript
import { setLogLevel } from "@azure/logger";

```bash
export AZURE_LOG_LEVEL=verbose
setLogLevel("info");
```

For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger).
Expand Down

0 comments on commit 3738fa3

Please sign in to comment.