If verbose mode is on, log error messages to stdout
(self, module, func, msg=None)
| 297 | self.settings.load() |
| 298 | |
| 299 | def log(self, module, func, msg=None): |
| 300 | """ |
| 301 | If verbose mode is on, log error messages to stdout |
| 302 | """ |
| 303 | if self.verbose: |
| 304 | timestamp = time.strftime("%b %d %Y %X") |
| 305 | final_msg = f"{Fore.LIGHTBLACK_EX + Style.DIM}[{timestamp}]{Style.RESET_ALL} {Fore.WHITE + Style.DIM}{module}.{func}{Style.RESET_ALL}" |
| 306 | if msg: |
| 307 | final_msg = ( |
| 308 | f"{final_msg}{Fore.WHITE + Style.DIM}: {msg}{Style.RESET_ALL}" |
| 309 | ) |
| 310 | print(final_msg) |
| 311 | |
| 312 | def get_resource_path(self, filename): |
| 313 | """ |
no outgoing calls