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

Colored logging configuration + displaying progress in logs #384

Merged
merged 2 commits into from
Apr 26, 2024

Conversation

cedricvidal
Copy link
Contributor

@cedricvidal cedricvidal commented Apr 24, 2024

Logging config

  • Colored logging using coloredlogs package
  • Logging configuration loaded from YAML config file, by default logging.yaml
  • Logging configuration YAML file location overridable with LOGGING_CONFIG env var

Displaying progress in logs

  • Added mdc dependency
  • Progress attached to MDC and included in logging format message
  • A default progress empty value is provided to avoid a KeyError when the progress field is not set, such as when logging from a different thread

Here is what it looks like when we're hitting quota limits and getting some retries, it displays progress and colored logs:
Screenshot 2024-04-23 at 8 33 07 PM

Here is what it looks like when it runs smoothly:
Screenshot 2024-04-25 at 8 53 02 PM

Tests

  • Tested non regression with OpenAI API
  • Tested with Azure AI Resource Real Time gpt-3.5-turbo and text-embedding-ada-002 deployment

Note: this PR depends on #381

@cedricvidal cedricvidal force-pushed the logging-conf branch 2 times, most recently from a7ab3b3 to 9848464 Compare April 26, 2024 03:47
- Colored logging
- YAML config
- Config file location set using LOGGING_CONFIG env var, defaults to logging.yaml
- Added mdc dependency

Fixed progress calculation
@ShishirPatil ShishirPatil merged commit 5a85047 into ShishirPatil:main Apr 26, 2024
devanshamin pushed a commit to devanshamin/gorilla that referenced this pull request Jul 9, 2024
…atil#384)

**Logging config**
- Colored logging using `coloredlogs` package
- Logging configuration loaded from YAML config file, by default
`logging.yaml`
- Logging configuration YAML file location overridable with
`LOGGING_CONFIG` env var

**Displaying progress in logs**
- Added mdc dependency
- Progress attached to MDC and included in logging format message
- A default progress empty value is provided to avoid a KeyError when
the progress field is not set, such as when logging from a different
thread

Here is what it looks like when we're hitting quota limits and getting
some retries, it displays progress and colored logs:
![Screenshot 2024-04-23 at 8 33
07 PM](https://github.com/ShishirPatil/gorilla/assets/33618/591a8093-0b02-451a-96bb-9b639d0a8fc5)

Here is what it looks like when it runs smoothly:
![Screenshot 2024-04-25 at 8 53
02 PM](https://github.com/ShishirPatil/gorilla/assets/33618/d022c38d-a2c5-4b02-8d0f-06b8d8275c12)

**Tests**

- Tested non regression with OpenAI API
- Tested with Azure AI Resource Real Time `gpt-3.5-turbo` and
`text-embedding-ada-002` deployment

**Note**: this PR depends on ShishirPatil#381
aw632 pushed a commit to vinaybagade/gorilla that referenced this pull request Aug 22, 2024
…atil#384)

**Logging config**
- Colored logging using `coloredlogs` package
- Logging configuration loaded from YAML config file, by default
`logging.yaml`
- Logging configuration YAML file location overridable with
`LOGGING_CONFIG` env var

**Displaying progress in logs**
- Added mdc dependency
- Progress attached to MDC and included in logging format message
- A default progress empty value is provided to avoid a KeyError when
the progress field is not set, such as when logging from a different
thread

Here is what it looks like when we're hitting quota limits and getting
some retries, it displays progress and colored logs:
![Screenshot 2024-04-23 at 8 33
07 PM](https://github.com/ShishirPatil/gorilla/assets/33618/591a8093-0b02-451a-96bb-9b639d0a8fc5)

Here is what it looks like when it runs smoothly:
![Screenshot 2024-04-25 at 8 53
02 PM](https://github.com/ShishirPatil/gorilla/assets/33618/d022c38d-a2c5-4b02-8d0f-06b8d8275c12)

**Tests**

- Tested non regression with OpenAI API
- Tested with Azure AI Resource Real Time `gpt-3.5-turbo` and
`text-embedding-ada-002` deployment

**Note**: this PR depends on ShishirPatil#381
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.

2 participants