Made _format_msg() a private function.

This commit is contained in:
The Wobbler 2025-01-13 20:03:32 +01:00
parent def727006b
commit d8a48dd105

View file

@ -52,10 +52,10 @@ class Log:
: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:
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)
@ -104,7 +104,7 @@ class Log:
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:
formatted_msg = _msg_types[msg_type] + msg
formatted_msg += format_string("§rs")