Skip to content

Commit 4dfcc80

Browse files
committed
Upd logging; warning instead of warn
1 parent e0df6b5 commit 4dfcc80

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

thingsdb/client/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ async def _on_room(self, room_id, pkg):
561561
try:
562562
room = self._rooms[room_id]
563563
except KeyError:
564-
logging.warn(
564+
logging.warning(
565565
f'Got an event (tp:{pkg.tp}) for room Id {room_id} but '
566566
f'the room is not known by the ThingsDB client')
567567
else:
@@ -585,11 +585,12 @@ def _on_event(self, pkg):
585585
except KeyError:
586586
if pkg.tp == Proto.ON_WARN:
587587
warn = pkg.data
588-
logging.warn(
588+
logging.warning(
589589
f'ThingsDB: '
590590
f'{warn["warn_msg"]} ({warn["warn_code"]})')
591591
else:
592-
logging.warn(f'Unexpected event: tp:{pkg.tp} data:{pkg.data}')
592+
logging.warning(
593+
f'Unexpected event: tp:{pkg.tp} data:{pkg.data}')
593594
else:
594595
asyncio.ensure_future(self._on_room(room_id, pkg), loop=self._loop)
595596

thingsdb/client/package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def extract_data_from(self, barray: bytearray) -> None:
4848
except Exception:
4949
logging.exception('')
5050
else:
51-
logging.warn(
51+
logging.warning(
5252
f'Wrote the content from {self} to `{_fail_file}`')
5353
raise e
5454
finally:

thingsdb/room/roombase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ async def join(self, client: Client, wait: Optional[float] = 60.0):
121121

122122
if self._id in client._rooms:
123123
prev = client._rooms[self._id]
124-
logging.warn(
124+
logging.warning(
125125
f'Room Id {self._id} is previously registered by {prev} '
126126
f'and will be overwritten with {self}')
127127

thingsdb/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.0.6-alpha2'
1+
__version__ = '1.0.6-alpha3'

0 commit comments

Comments
 (0)