-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b50965a
commit b5774af
Showing
9 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
########################################################## | ||
# | ||
# Copyright (C) 2023-PRESENT: Keivan Ipchi Hagh | ||
# | ||
# Email: [email protected] | ||
# GitHub: https://github.com/keivanipchihagh | ||
# | ||
########################################################## | ||
|
||
from colorama import Fore | ||
from pytz import timezone | ||
from datetime import datetime | ||
from colorama import init as colorama_init | ||
|
||
colorama_init() | ||
TZ = timezone('Asia/Tehran') # Timezone | ||
|
||
|
||
def __now() -> str: | ||
""" Returns the current datetime as string """ | ||
return datetime.now(TZ).strftime('%Y-%m-%d %H:%M:%S') | ||
|
||
|
||
def debug(message: str) -> None: | ||
""" Prints a message as debug """ | ||
print(f"[{Fore.MAGENTA}DEBUG{Fore.BLUE} - {Fore.BLACK}{__now()}{Fore.RESET}]\t{message}") | ||
|
||
|
||
def info(message: str) -> None: | ||
""" Prints a message as info """ | ||
print(f"[{Fore.BLUE}INFO{Fore.BLUE} - {Fore.BLACK}{__now()}{Fore.RESET}]\t{message}") | ||
|
||
|
||
def success(message: str) -> None: | ||
""" Prints a message as success """ | ||
print(f"[{Fore.GREEN}SUCCESS{Fore.RESET} - {Fore.BLACK}{__now()}{Fore.RESET}]\t{message}") | ||
|
||
|
||
def error(message: str) -> None: | ||
""" Prints a message as error """ | ||
print(f"[{Fore.RED}ERROR{Fore.RESET} - {Fore.BLACK}{__now()}{Fore.RESET}]\t{message}") | ||
|
||
|
||
def warning(message: str) -> None: | ||
""" Prints a message as warning """ | ||
print(f"[{Fore.YELLOW}WARNING{Fore.RESET} - {Fore.BLACK}{__now()}{Fore.RESET}]\t{message}") |