Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor logging to use an object rather than the logging module #57

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

pcmxgti
Copy link
Contributor

@pcmxgti pcmxgti commented Sep 2, 2021

Changes the way we log from logging.level() to logger.level(). This
is a more standardized and accepted way of logging in python.

We also add timing information to the logs, together with the correct
module name and common practice logging format. E.g.

From:

DEBUG [helpers.py:validate_okta_aws_app_url():422]: ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
ERROR [helpers.py:process_okta_aws_app_url():523]: Okta Application URL not found, or invalid. Please check your configuration and try again.

To:

2021-09-02 11:51:35,898 tokendito.helpers [validate_okta_aws_app_url():414] - DEBUG - ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
2021-09-02 11:51:35,898 tokendito.helpers [process_okta_aws_app_url():515] - ERROR - Okta Application URL not found, or invalid. Please check your configuration and try again.

Changes the way we log from logging.level() to logger.leve(). This
is a more standardized and accepted way of logging in python.

We also add timining information to the logs, together with the correct
module name and common practice logging format. E.g.

From:
```
DEBUG [helpers.py:validate_okta_aws_app_url():422]: ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
ERROR [helpers.py:process_okta_aws_app_url():523]: Okta Application URL not found, or invalid. Please check your configuration and try again.
```

to:
```
2021-09-02 11:51:35,898 tokendito.helpers [validate_okta_aws_app_url():414] - DEBUG - ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
2021-09-02 11:51:35,898 tokendito.helpers [process_okta_aws_app_url():515] - ERROR - Okta Application URL not found, or invalid. Please check your configuration and try again.
```
@sevignyj sevignyj merged commit 0feb543 into feature/2.0.0 Sep 2, 2021
@pcmxgti pcmxgti deleted the fix/refactor_logging branch September 14, 2021 10:46
pcmxgti added a commit that referenced this pull request Sep 7, 2022
Changes the way we log from logging.level() to logger.leve(). This
is a more standardized and accepted way of logging in python.

We also add timining information to the logs, together with the correct
module name and common practice logging format. E.g.

From:
```
DEBUG [helpers.py:validate_okta_aws_app_url():422]: ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
ERROR [helpers.py:process_okta_aws_app_url():523]: Okta Application URL not found, or invalid. Please check your configuration and try again.
```

to:
```
2021-09-02 11:51:35,898 tokendito.helpers [validate_okta_aws_app_url():414] - DEBUG - ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
2021-09-02 11:51:35,898 tokendito.helpers [process_okta_aws_app_url():515] - ERROR - Okta Application URL not found, or invalid. Please check your configuration and try again.
```
pcmxgti added a commit that referenced this pull request Sep 23, 2022
Changes the way we log from logging.level() to logger.leve(). This
is a more standardized and accepted way of logging in python.

We also add timining information to the logs, together with the correct
module name and common practice logging format. E.g.

From:
```
DEBUG [helpers.py:validate_okta_aws_app_url():422]: ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
ERROR [helpers.py:process_okta_aws_app_url():523]: Okta Application URL not found, or invalid. Please check your configuration and try again.
```

to:
```
2021-09-02 11:51:35,898 tokendito.helpers [validate_okta_aws_app_url():414] - DEBUG - ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
2021-09-02 11:51:35,898 tokendito.helpers [process_okta_aws_app_url():515] - ERROR - Okta Application URL not found, or invalid. Please check your configuration and try again.
```
pcmxgti added a commit that referenced this pull request Nov 11, 2022
Changes the way we log from logging.level() to logger.leve(). This
is a more standardized and accepted way of logging in python.

We also add timining information to the logs, together with the correct
module name and common practice logging format. E.g.

From:
```
DEBUG [helpers.py:validate_okta_aws_app_url():422]: ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
ERROR [helpers.py:process_okta_aws_app_url():523]: Okta Application URL not found, or invalid. Please check your configuration and try again.
```

to:
```
2021-09-02 11:51:35,898 tokendito.helpers [validate_okta_aws_app_url():414] - DEBUG - ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
2021-09-02 11:51:35,898 tokendito.helpers [process_okta_aws_app_url():515] - ERROR - Okta Application URL not found, or invalid. Please check your configuration and try again.
```
sevignyj pushed a commit that referenced this pull request Dec 16, 2022
Changes the way we log from logging.level() to logger.leve(). This
is a more standardized and accepted way of logging in python.

We also add timining information to the logs, together with the correct
module name and common practice logging format. E.g.

From:
```
DEBUG [helpers.py:validate_okta_aws_app_url():422]: ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
ERROR [helpers.py:process_okta_aws_app_url():523]: Okta Application URL not found, or invalid. Please check your configuration and try again.
```

to:
```
2021-09-02 11:51:35,898 tokendito.helpers [validate_okta_aws_app_url():414] - DEBUG - ParseResultBytes(scheme=b'', netloc=b'', path=b'', params=b'', query=b'', fragment=b'') does not look like a valid match.
2021-09-02 11:51:35,898 tokendito.helpers [process_okta_aws_app_url():515] - ERROR - Okta Application URL not found, or invalid. Please check your configuration and try again.
```
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.

None yet

2 participants