Made _format_msg() a private function.
This commit is contained in:
parent
def727006b
commit
d8a48dd105
1 changed files with 3 additions and 3 deletions
|
@ -52,10 +52,10 @@ class Log:
|
||||||
:param prefix: An optional prefix that gets added at the beginning of the message.
|
:param prefix: An optional prefix that gets added at the beginning of the message.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
logfile_msg = self.format_msg(msg, msg_type, self.file_colored, prefix) + "\n"
|
logfile_msg = self._format_msg(msg, msg_type, self.file_colored, prefix) + "\n"
|
||||||
|
|
||||||
if self.console_out:
|
if self.console_out:
|
||||||
console_msg = self.format_msg(msg, msg_type, self.console_colored, prefix)
|
console_msg = self._format_msg(msg, msg_type, self.console_colored, prefix)
|
||||||
|
|
||||||
print(console_msg)
|
print(console_msg)
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ class Log:
|
||||||
|
|
||||||
self.write(msg, "error", prefix)
|
self.write(msg, "error", prefix)
|
||||||
|
|
||||||
def format_msg(self, msg: str, msg_type: str="info", colored: bool=True, prefix: str=""):
|
def _format_msg(self, msg: str, msg_type: str= "info", colored: bool=True, prefix: str= ""):
|
||||||
if colored:
|
if colored:
|
||||||
formatted_msg = _msg_types[msg_type] + msg
|
formatted_msg = _msg_types[msg_type] + msg
|
||||||
formatted_msg += format_string("§rs")
|
formatted_msg += format_string("§rs")
|
||||||
|
|
Loading…
Reference in a new issue