Skip to content

Replace deprecated logging.warn with logging.warning #140

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

Merged
merged 1 commit into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ def block_fallback(props):
type_ = props['block']['type']

if type_ == 'example-discard':
logging.warn(f'Missing config for "{type_}". Discarding block, keeping content.')
logging.warning(f'Missing config for "{type_}". Discarding block, keeping content.')
# Directly return the block's children to keep its content.
return props['children']
elif type_ == 'example-delete':
logging.error(f'Missing config for "{type_}". Deleting block.')
# Return None to not render anything, removing the whole block.
return None
else:
logging.warn(f'Missing config for "{type_}". Using div instead.')
logging.warning(f'Missing config for "{type_}". Using div instead.')
# Provide a fallback.
return DOM.create_element('div', {}, props['children'])
```
Expand Down
2 changes: 1 addition & 1 deletion benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def link(props):
def block_fallback(props):
type_ = props["block"]["type"]

logging.warn(f'Missing config for "{type_}".')
logging.warning(f'Missing config for "{type_}".')
return DOM.create_element("div", {}, props["children"])


Expand Down