Skip to content

Commit

Permalink
Added support for prefix to be none
Browse files Browse the repository at this point in the history
  • Loading branch information
sexfrance committed Nov 9, 2024
1 parent de3fa0d commit be3d0af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions logmagix/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pystyle import Write, System, Colors

class Logger:
def __init__(self, prefix: str = "discord.cyberious.xyz"):
def __init__(self, prefix: str | None = "discord.cyberious.xyz"):
self.WHITE = "\u001b[37m"
self.MAGENTA = "\033[38;5;97m"
self.MAGENTAA = "\033[38;2;157;38;255m"
Expand All @@ -19,7 +19,7 @@ def __init__(self, prefix: str = "discord.cyberious.xyz"):
self.BLUE = "\033[38;5;21m"
self.PINK = "\033[38;5;176m"
self.CYAN = "\033[96m"
self.prefix = f"{self.PINK}[{self.MAGENTA}{prefix}{self.PINK}] "
self.prefix = f"{self.PINK}[{self.MAGENTA}{prefix}{self.PINK}] " if prefix else f"{self.PINK}"

def get_time(self) -> str:
return datetime.datetime.now().strftime("%H:%M:%S")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="logmagix",
version="1.10.2",
version="1.10.3",
packages=find_packages(),
install_requires=["colorama"],
author="Sexfrance",
Expand Down
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import time
import uuid

log = Logger(prefix="custom/log/prefix")
log = Logger(prefix=None)
start_time = time.time()

# Log messages
Expand Down

0 comments on commit be3d0af

Please sign in to comment.