Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: debug logging color optmized #41

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/nebulagraph_lite/nebulagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ def _run_udocker(self, command: str, env: str = None):
f"udocker command failed with return code {result.returncode}"
)
if output and self._debug:
fancy_print(f"Info: [DEBUG] udocker command output:\n{output.decode()}")
fancy_print(
f"Info: [DEBUG] udocker command output:\n{output.decode()}",
color="blue",
)
return result

def _run_udocker_ps_filter(self, filter: str):
Expand Down
6 changes: 3 additions & 3 deletions src/nebulagraph_lite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Thanks to https://www.learnui.design/tools/data-color-picker.html
COLORS_hex = {
# "dark_blue": "#003f5c",
# "blue": "#2f4b7c",
"blue": "#2f4b7c",
"purple": "#665191",
"magenta": "#a05195",
"pink": "#d45087",
Expand All @@ -20,7 +20,7 @@

COLORS_rgb = {
# "dark_blue": "38;2;0;63;92",
# "blue": "38;2;47;75;124",
"blue": "38;2;47;75;124",
"purple": "38;2;102;81;145",
"magenta": "38;2;160;81;149",
"pink": "38;2;212;80;135",
Expand Down Expand Up @@ -75,7 +75,7 @@ def wrapper(*args, **kwargs):
return decorator


def fancy_print(text: str, color: str = "Blue") -> None:
def fancy_print(text: str, color: str = "random") -> None:
"""
Print a string in color from COLORS_rgb.
"""
Expand Down
Loading