Skip to content

Conversation

@shalousun
Copy link

@shalousun shalousun commented Sep 19, 2025

Related Issue

closes #640

Checklist

  • I have read the CONTRIBUTING guidelines.
  • I have added tests to cover my changes.
  • I have updated the documentation (docs folder) accordingly.

Additional Notes

Add any other context about the PR here.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces customizable logging format support to the Infinity embedding library, allowing users to configure logging behavior through environment variables. The changes span three key files:

Core logging configuration (log_handler.py): Adds two new environment variables - INFINITY_DISABLE_RICH_HANDLER to optionally disable Rich console formatting and INFINITY_LOG_FORMAT to specify custom log message formats. The implementation restructures handler initialization to conditionally use Rich formatting, falling back to standard StreamHandler when Rich is disabled or unavailable.

CLI server integration (cli.py): Introduces a new set_uvicorn_logging_configs() function that enables customization of Uvicorn server log formats through three additional environment variables (INFINITY_UVICORN_DEFAULT_FORMAT, INFINITY_UVICORN_ACCESS_FORMAT, INFINITY_UVICORN_DATE_FORMAT). This function modifies the global Uvicorn logging configuration and is called before server startup.

Environment management (env.py): Extends the environment configuration system with five new @cached_property methods that provide centralized access to all the new logging-related environment variables with sensible defaults.

These changes maintain backward compatibility by preserving existing default behavior while providing opt-in customization capabilities. This addresses production deployment needs where logs must integrate with specific monitoring systems or follow organizational standards.

Confidence score: 3/5

  • This PR has implementation issues that could cause problems in production environments
  • Score lowered due to inconsistent environment variable handling between files and formatting problems in env.py
  • Pay close attention to libs/infinity_emb/infinity_emb/env.py for malformed default value and libs/infinity_emb/infinity_emb/cli.py for hardcoded environment variable names

3 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

@shalousun shalousun force-pushed the main branch 3 times, most recently from 50239f0 to ef5fda5 Compare September 19, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Customizable Logging Format in Infinity

1 participant