-
Notifications
You must be signed in to change notification settings - Fork 16
Refactored ConsoleLogger to fix emoji handling and ensure consistency… #600
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
base: main
Are you sure you want to change the base?
Conversation
@cristipufu |
be5ad76
to
48c243d
Compare
src/uipath/_cli/_utils/_console.py
Outdated
SELECT = "👇" | ||
LINK = "🔗" | ||
MAGIC = "✨" | ||
INFO = "\u2139" # ℹ️ (INFORMATION SOURCE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INFO = "\u2139" # ℹ️ (INFORMATION SOURCE) | |
INFO = "" # (INFORMATION SOURCE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
- Updated all ConsoleLogger convenience methods to pass Enum members instead of .value - Fixed log() to extract emoji with level.value internally, maintaining type-safety - Ensured error messages use level == LogLevel.ERROR for stderr - Made evaluation progress methods consistent with LogLevel Unicode symbols - Overall: logging and progress updates now reliably display intended Unicode symbols -> recent change: updated "info" unicode to empty string.
48c243d
to
e4b1582
Compare
if fg: | ||
formatted_message = f"{emoji} {click.style(message, fg=fg)}" if emoji else click.style(message, fg=fg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can simplify the logic here:
if fg: | |
formatted_message = f"{emoji} {click.style(message, fg=fg)}" if emoji else click.style(message, fg=fg) | |
formatted_message = f"{level.value} " if level.value else "" | |
formatted_message += click.style(message, fg=fg) if fg else message |
… with LogLevel Enum: