You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documents/FAQ.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,12 @@
16
16
If you are just getting started make sure you [install this sdk](https://github.com/aws/aws-iot-device-sdk-python-v2#installation) and then build and run the [basic PubSub](https://github.com/aws/aws-iot-device-sdk-python-v2/tree/main/samples#pubsub)
17
17
18
18
### How do I enable logging?
19
+
To enable logging you must import `io` from `awscrt` and initialize it with `init_logging`.
19
20
21
+
`LogLevel` can be set to `Fatal`, `Error`, `Warn`, `Info`, `Debug`, or `Trace`. `stderr` and `stdout` can be used to print logs while any other string will be assumed to be a file path.
20
22
```python
23
+
from awscrt import io
24
+
# This sets the logger to print any Error level logs to stderr
21
25
io.init_logging(io.LogLevel.Error, 'stderr')
22
26
```
23
27
You can also enable [CloudWatch logging](https://docs.aws.amazon.com/iot/latest/developerguide/cloud-watch-logs.html) for IoT which will provide you with additional information that is not available on the client side sdk.
*[Enable Logging in Samples](#enable-logging-in-samples)
11
+
*[Enable Logging](#enable-logging)
12
12
13
13
14
14
## Samples
@@ -39,9 +39,9 @@ This directory contains sample applications for [aws-iot-device-sdk-python-v2](.
39
39
|[Greengrass Discovery](./greengrass//basic_discovery.md)| Discover and connect to a local Greengrass core. |
40
40
|[Greengrass IPC](./greengrass//ipc_greengrass.md)| Demonstrates Inter-Process Communication (IPC) with Greengrass components. |
41
41
42
-
### Build Instructions
42
+
### Instructions
43
43
44
-
First, install the `aws-iot-devices-sdk-python-v2` with following the [Installation Instructions](../README.md#Installation).
44
+
First, install `aws-iot-devices-sdk-python-v2`. Installation instructions for the SDK are [Provided Here](../README.md#Installation).
45
45
46
46
Each sample's README contains prerequisites, arguments, and detailed instructions. For example, the [MQTT5 X509 Sample README](./mqtt/mqtt5_x509.md) is `mqtt5_x509.md` and the sample can be run with the following command:
47
47
@@ -80,6 +80,6 @@ optional arguments:
80
80
81
81
The sample will not run without the required arguments and will notify you of missing arguments.
82
82
83
-
### Enable logging in samples
83
+
### Enable Logging
84
84
85
-
To enable logging in the samples, you can follow the instructions provided in the [FAQ](../documents/FAQ.md)related to [enabling logs](../documents/FAQ.md#how-do-i-enable-logging).
85
+
Instructions to enable logging are available in the [FAQ](../documents/FAQ.md)under [How do I enable logging](../documents/FAQ.md#how-do-i-enable-logging).
0 commit comments