Skip to content

Commit f496098

Browse files
committed
Update logging
1 parent 2fb2a12 commit f496098

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/custom_logging.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@ def getMessage(self) -> str:
7979
Returns:
8080
str: Returns the message
8181
"""
82-
msg = str(self.msg)
83-
if isinstance(self.args, dict):
84-
return msg.format(self.args)
85-
return msg % self.args if self.args else msg
82+
msg = self.msg
83+
if self.args:
84+
if isinstance(self.args, dict):
85+
msg = msg.format(**self.args)
86+
else:
87+
msg = msg.format(*self.args)
88+
return msg
8689

8790

8891
class CustomColorFormatter(logging.Formatter):

0 commit comments

Comments
 (0)