Coding Global Background
Coding Global

Colorful Console Output function parameter

Archived 2 years ago
2 messages
0 members
Created 3 years ago
Updated 3 years ago
Open in Discord
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)

Replies (2)