Skip to content

Commit 4a2e87c

Browse files
authored
Merge pull request #4 from LaswitchTech/dev
General: Version bumped to v1.0.3
2 parents 5438961 + ef1413d commit 4a2e87c

11 files changed

Lines changed: 370 additions & 276 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.2
1+
v1.0.3

configuration.py

100755100644
File mode changed.

helper.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ def __init__(self, root_dir: str | None = None, script_dir: str | None = None):
3131

3232
self.home_dir = os.path.expanduser("~")
3333

34-
# ---------- OS / paths ----------
35-
3634
def get_path(self, rel_path: str) -> str | None:
3735
rel = rel_path.replace("\\", "/")
3836

@@ -115,6 +113,11 @@ def get_screen_resolution() -> tuple[int, int]:
115113
size = screen.size()
116114
return (size.width(), size.height())
117115

116+
@staticmethod
117+
def get_now() -> str:
118+
from datetime import datetime
119+
return datetime.now().strftime("%Y-%m-%d %H:%M:%S")
120+
118121
@staticmethod
119122
def file_exists(path: str | None) -> bool:
120123
return bool(path) and os.path.isfile(path)

icons/check-circle.svg

Lines changed: 1 addition & 1 deletion
Loading

icons/circle.svg

Lines changed: 3 additions & 0 deletions
Loading

icons/spinner.svg

Lines changed: 3 additions & 0 deletions
Loading

icons/success.svg

Lines changed: 4 additions & 0 deletions
Loading

log.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ def append(self, message: str, channel: str = "default", level: str = "info") ->
8787
# Normalize to individual lines
8888
lines = message.splitlines() or [message]
8989

90-
# Check if verbose logging is enabled and print to console
91-
if self._configuration.get("log.verbose"):
92-
for ln in lines:
93-
print(f"[{channel}] {ln}")
90+
# Format each line with timestamp, level, channel
91+
for ln in lines:
92+
line = f"[{self._helper.get_now()}][{level.upper()}][{channel}] {ln}"
93+
lines[lines.index(ln)] = line
94+
95+
# Check if verbose logging is enabled and print to console
96+
if self._configuration.get("log.verbose"):
97+
print(line)
9498

9599
# Append lines to the buffer
96100
with self._lock:

0 commit comments

Comments
 (0)