Skip to content

Commit

Permalink
Merge pull request #41 from nebula-contrib/fix_debug_log_color
Browse files Browse the repository at this point in the history
chore: debug logging color optmized
  • Loading branch information
wey-gu authored Mar 6, 2024
2 parents 6bcc073 + 408d2cb commit a7cb7b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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

0 comments on commit a7cb7b6

Please sign in to comment.