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

[Bugfix] Fix call to init_logger in openai server #4765

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NadavShmayo
Copy link
Contributor

Currently when running the OpenAI entrypoint, all logs coming from this file will not be shown.
This is because the call to init_logger at the top of the file uses the __name__ global variable, and it's value is __main__ since this is the main file, which causes the init_logger function to return a logger with default configuration instead of the one configured in the logger file.

To solve this I changed the call to init_logger to pass a string instead of __name__, but another possible and potentially more elegant solution would be changing the init_logger function so the logger name is optional, and omitting it in the OpenAI entrypoint:

def init_logger(name: str = None) -> Logger:
    """The main purpose of this function is to ensure that loggers are
    retrieved in such a way that we can be sure the root vllm logger has
    already been configured."""

    return logging.getLogger(name or 'vllm')

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.

None yet

1 participant