Made some attributes protected.

This commit is contained in:
The Wobbler 2025-03-26 14:17:01 +01:00
parent 62f25f3392
commit 1487575015

View file

@ -35,9 +35,9 @@ class Log:
"""
self.log_path = log_path
self.console_out = console_out
self.console_colored = console_colored
self.file_colored = file_colored
self._console_out = console_out
self._console_colored = console_colored
self._file_colored = file_colored
def write(self, msg: str, msg_type: str = "info", prefix: str = ""):
"""
@ -48,10 +48,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)
if self._console_out:
console_msg = self._format_msg(msg, msg_type, self._console_colored, prefix)
print(console_msg)