Correct logging interpolation format

This commit is contained in:
DarkCat09 2022-09-30 14:39:16 +04:00
parent 5326450e8e
commit 9ea8795bdb
4 changed files with 17 additions and 18 deletions

View file

@ -39,8 +39,6 @@ disable=raw-checker-failed,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
logging-not-lazy,
logging-fstring-interpolation,
no-member,
too-many-arguments,
too-many-public-methods,
@ -134,7 +132,7 @@ redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
[LOGGING]
logging-format-style=new
logging-format-style=old
logging-modules=logging

View file

@ -170,7 +170,7 @@ class Client:
"""
file = os.path.expanduser(file)
logging.debug(f'Restoring session from {file}')
logging.debug('Restoring session from %s', file)
if not os.path.exists(file):
raise FileNotFoundError()
@ -255,7 +255,7 @@ class Client:
"""
file = os.path.expanduser(file)
logging.debug(f'Saving session to {file}')
logging.debug('Saving session to %s', file)
with open(file, 'wt', encoding='utf-8') as f:
@ -277,12 +277,12 @@ class Client:
"""
file = os.path.expanduser(file)
logging.debug(f'Removing session file: {file}')
logging.debug('Removing session file: %s', file)
try:
os.remove(file)
except OSError as err:
logging.warning(f'Unable to delete session file: {err}')
logging.warning('Unable to delete session file: %s', err)
def list_servers(self, cache: bool = True) -> List[AternosServer]:
@ -313,7 +313,7 @@ class Client:
try:
self.save_session(self.saved_session)
except OSError as err:
logging.warning(f'Unable to save servers list to file: {err}')
logging.warning('Unable to save servers list to file: %s', err)
return self.servers
@ -333,7 +333,7 @@ class Client:
if servid == '':
continue
logging.debug(f'Adding server {servid}')
logging.debug('Adding server %s', servid)
srv = AternosServer(servid, self.atconn)
self.servers.append(srv)

View file

@ -221,12 +221,12 @@ class AternosConnect:
reqcookies['ATERNOS_SESSION'] = self.atsession
del self.session.cookies['ATERNOS_SESSION']
logging.debug(f'Requesting({method}){url}')
logging.debug(f'headers={headers}')
logging.debug(f'params={params}')
logging.debug(f'data={data}')
logging.debug(f'req-cookies={reqcookies}')
logging.debug(f'session-cookies={self.session.cookies}')
logging.debug('Requesting(%s)%s', method, url)
logging.debug('headers=%s', headers)
logging.debug('params=%s', params)
logging.debug('data=%s', data)
logging.debug('req-cookies=%s', reqcookies)
logging.debug('session-cookies=%s', self.session.cookies)
if method == 'POST':
sendreq = partial(
@ -260,9 +260,10 @@ class AternosConnect:
sendtoken, retry - 1
)
logging.debug('AternosConnect received: ' + req.text[:65])
logging.debug('AternosConnect received: %s', req.text[:65])
logging.info(
f'{method} completed with {req.status_code} status'
'%s completed with %s status',
method, req.status_code
)
if req.status_code == 402:

View file

@ -174,7 +174,7 @@ class AternosWss:
continue
if strm.stream:
logging.debug(f'Requesting {strm.stream} stream')
logging.debug('Requesting %s stream', strm.stream)
await self.send({
'stream': strm.stream,
'type': 'start'