Coding Global Background
Coding Global

Colorful Console Output function parameter

Archiviert 2 years ago
2 Nachrichten
0 Mitglieder
Erstellt 3 years ago
Aktualisiert 3 years ago
In Discord öffnen
I
infinimonster
In joinify.py when i try to use the log function like this:
log(log_text="Could not load the config.toml file.", printtype="error", threadindex=None)

printtype seem to appear as empty string inside utility.py and so it ofc won't colorize anything. manually adding an type inside the logfunction works but i need to get it working with the argument
def log(log_text=None, printtype=None, threadindex=None):
    if log_text is None: print(); return
    print("printype: ", printtype)
    print(f"{current_time()}{colorize('error', 1)} some error")
    log_output = f"{current_time()}{colorize(printtype, threadindex)} {log_text}"
    print(log_output)

Antworten (2)