Skip to content

Commit 8cf1d63

Browse files
committed
Added how to enable logging in readme
1 parent f373b33 commit 8cf1d63

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ Authorize.Net maintains a complete sandbox environment for testing and developme
5151

5252
API credentials are different for each environment, so be sure to switch to the appropriate credentials when switching environments.
5353

54+
### Enable Logging in the SDK
55+
Python sdk uses the logger *'authorizenet.sdk'*. By default the logger is not configured in the sdk for writing output. If you need logging in the sdk, you should configure the logger in your code according to your need.
56+
57+
A sample logger configuration is given as below:
58+
59+
```python
60+
import logging
61+
logger = logging.getLogger('authorizenet.sdk')
62+
handler = logging.FileHandler('anetSdk.log')
63+
formatter = logging.Formatter('%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
64+
handler.setFormatter(formatter)
65+
logger.addHandler(handler)
66+
logger.setLevel(logging.DEBUG)
67+
logger.debug('Logger set up for Authorizenet Python SDK complete')
68+
```
69+
5470

5571
## SDK Usage Examples and Sample Code
5672
To get started using this SDK, it's highly recommended to download our sample code repository:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy