orthographic/log.py

38 lines
1.3 KiB
Python

# -------------------------------------------------------------------
# ORTHOGRAPHIC
# Your personal aerial satellite. Always on. At any altitude.*
# Developed by MarStrMind
# License: Open Software License 3.0
# Up to date version always on marstr.online
# -------------------------------------------------------------------
# log.py
# Convenience call to log output
# -------------------------------------------------------------------
import datetime
from colorama import init as colorama_init
from colorama import Fore
from colorama import Style
from defines import *
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
def mstr_msg(fnc, msg):
if mstr_show_log == True:
colorama_init()
now = datetime.datetime.now()
print(f' {Fore.GREEN}'+now.strftime("%H:%M:%S")+f'{Style.RESET_ALL} | {Fore.YELLOW}[' + fnc + f']{Style.RESET_ALL} | {Fore.CYAN}'+ msg + f'{Style.RESET_ALL}')
#print(f"{Fore.GREEN}" + now.strftime(" %H:%M:%S" + " | ["+fnc+"] | " + msg))
def mstr_important_msg(fnc, msg):
colorama_init()
now = datetime.datetime.now()
print(f' {Fore.GREEN}' + now.strftime(
"%H:%M:%S") + f'{Style.RESET_ALL} | {Fore.YELLOW}[' + fnc + f']{Style.RESET_ALL} | {Fore.CYAN}' + msg + f'{Style.RESET_ALL}')