-
Notifications
You must be signed in to change notification settings - Fork 10
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: nhairs/python-json-logger
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.3.0
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: nhairs/python-json-logger
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 6 commits
- 9 files changed
- 5 contributors
Commits on Mar 30, 2025
-
[core] support DictConfigurator prefixes for rename_fields and static…
…_fields (#45) Python logging config supports access to [external](https://docs.python.org/3/library/logging.config.html#access-to-external-objects) and [internal](https://docs.python.org/3/library/logging.config.html#access-to-internal-objects) objects via [DictConfiguator](https://docs.python.org/3/library/logging.config.html#configuration-functions) prefixes. This works internally by warpping the dict with a [ConvertingDict](https://github.com/python/cpython/blob/main/Lib/logging/config.py#L337) that requires an explicit call to it's [\_\_getitem\_\_](https://github.com/python/cpython/blob/main/Lib/logging/config.py#L340) dunder method for the [conversion](https://github.com/python/cpython/blob/main/Lib/logging/config.py#L307) to take place (using the specific converter for the specified prefix). This allows, for example, having a *log_config.yaml* file like: ```yaml version: 1 disable_existing_loggers: False formatters: default: "()": pythonjsonlogger.json.JsonFormatter format: "%(asctime)s %(levelname)s %(name)s %(module)s %(funcName)s %(lineno)s %(message)s" rename_fields: "asctime": "timestamp" "levelname": "status" static_fields: "service": ext://logging_config.PROJECT_NAME "env": ext://logging_config.ENVIRONMENT "version": ext://logging_config.PROJECT_VERSION "app_log": "true" handlers: default: formatter: default class: logging.StreamHandler stream: ext://sys.stderr access: formatter: default class: logging.StreamHandler stream: ext://sys.stdout loggers: uvicorn.error: level: INFO handlers: - default propagate: no uvicorn.access: level: INFO handlers: - access propagate: no ``` where *service*, *env* and *version* values are taken from the external resource *logging_config.py*. The content for *logging_config.py* could be something like (for getting some values from project metadata or environment variables): ```python import importlib.metadata import os def get_version_metadata(): # https://stackoverflow.com/a/78082532 version = importlib.metadata.version(PROJECT_NAME) return version PROJECT_NAME = 'test-api' PROJECT_VERSION = get_version_metadata() ENVIRONMENT = os.environ.get('ENVIRONMENT', 'dev') ``` --------- Co-authored-by: Nicholas Hairs <info@nicholashairs.com>
Configuration menu - View commit details
-
Copy full SHA for 6884b59 - Browse repository at this point
Copy the full SHA 6884b59View commit details
Commits on Apr 27, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 1f0cbd0 - Browse repository at this point
Copy the full SHA 1f0cbd0View commit details
Commits on Jun 26, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 27231ed - Browse repository at this point
Copy the full SHA 27231edView commit details -
[docs] Update documentation (#57)
Various minor fixes as suggested by jules.google --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 03ad4d1 - Browse repository at this point
Copy the full SHA 03ad4d1View commit details -
Per title --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for f36b8b5 - Browse repository at this point
Copy the full SHA f36b8b5View commit details
Commits on Jul 18, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 0843f52 - Browse repository at this point
Copy the full SHA 0843f52View commit details
Loading
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v3.3.0...main