Skip to content

Commit 0e3966b

Browse files
authored
Format logger style (#302)
## Summary <!-- Include a short paragraph of the changes introduced in this PR. If this PR requires additional context or rationale, explain why the changes are necessary. --> Older logger style is not clear to display which function:line_number to executed so that i append function_name and line_number and color the print. Refer to: <img width="1808" height="390" alt="image" src="https://github.com/user-attachments/assets/aefd2043-2580-448d-a7af-54f5851b2b34" /> ## Details <!-- Provide a detailed list of all changes introduced in this pull request. --> - [ ] ## Test Plan <!-- List the steps needed to test this PR. --> - ## Related Issues <!-- Link any relevant issues that this PR addresses. --> - Resolves # --- - [x] "I certify that all code in this PR is my own, except as noted below." ## Use of AI - [ ] Includes AI-assisted code completion - [ ] Includes code generated by an AI application - [ ] Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes `## WRITTEN BY AI ##`) Signed-off-by: guangli.bao <[email protected]>
1 parent af89787 commit 0e3966b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/guidellm/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ def configure_logger(config: LoggingSettings = settings.logging):
7171
logger.add(
7272
sys.stdout,
7373
level=config.console_log_level.upper(),
74-
format="{time} | {function} | {level} - {message}",
74+
format="<green>{time:YY-MM-DD HH:mm:ss}</green>|<level>{level: <8}</level> \
75+
|<cyan>{name}:{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>"
7576
)
7677

7778
if config.log_file or config.log_file_level:

0 commit comments

Comments
 (0)