Skip to content

Conversation

@gautamomento
Copy link
Contributor

@gautamomento gautamomento commented Jan 5, 2022

SDK Clients can enable/disable logs using:

  1. File configuration as https://docs.python.org/3/library/logging.config.html#configuration-file-format
    or
  2. By adding following lines of code to their application
logger = logging.getLogger('momentosdk')
logger.setLevel(logging.DEBUG)

consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.DEBUG)
logger.addHandler(consoleHandler)
formatter = logging.Formatter('%(asctime)s  %(name)s  %(levelname)s: %(message)s')
consoleHandler.setFormatter(formatter)

SDK Clients can enable/disable logs using:

1. logging.ini
or
2. By adding following lines of code to their application

```
logger = logging.getLogger('momentosdk')
logger.setLevel(logging.DEBUG)

consoleHandler = logging.StreamHandler()
consoleHandler.setLevel(logging.DEBUG)
logger.addHandler(consoleHandler)
formatter = logging.Formatter('%(asctime)s  %(name)s  %(levelname)s: %(message)s')
consoleHandler.setFormatter(formatter)
```
Copy link
Contributor

@bruuuuuuuce bruuuuuuuce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@gautamomento gautamomento merged commit 7e2c62b into main Jan 5, 2022
@gautamomento gautamomento deleted the u/gautam/debuglogs2 branch January 5, 2022 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants