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

vdk-core: VdkBoundLogger #2823

Merged
merged 13 commits into from
Oct 26, 2023
Merged

vdk-core: VdkBoundLogger #2823

merged 13 commits into from
Oct 26, 2023

Conversation

gageorgiev
Copy link
Contributor

This change introduces the VdkBoundLogger and addresses #2802.

Testing done: locally tested, ran a job with the following job code:

def run(job_input):
    import logging
    from vdk.internal.builtin_plugins.config.log_config import bind_logger

    bound = bind_logger(logging.getLogger(__name__), {"bound_key": "bound_value"})
    bound.warning("From vdk_initialize", extra={"first_key": "first_value", "second_key": "second_value"})
    bound.warning("Something else from vdk_initialize")

And the following config:

logging_metadata=timestamp,level,file_name,line_number,vdk_job_name,bound_key,second_key

And observed the following logs:

2023-10-23 15:17:42,547 [VDK] [WARNI]                10.py :5    gg-job4 bound_value second_value - From vdk_initialize
2023-10-23 15:17:42,548 [VDK] [WARNI]                10.py :6    gg-job4 bound_value  - Something else from vdk_initialize

This change introduces the VdkBoundLogger and addresses #2802.

Testing done: locally tested

Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
gageorgiev and others added 3 commits October 23, 2023 17:34
Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
…rsatile-data-kit into person/gageorgiev/bound-logger

Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
gageorgiev and others added 5 commits October 24, 2023 13:10
Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
…rsatile-data-kit into person/gageorgiev/bound-logger

Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
Signed-off-by: Gabriel Georgiev <gageorgiev@vmware.com>
@gageorgiev gageorgiev enabled auto-merge (squash) October 25, 2023 07:33
@gageorgiev gageorgiev merged commit 85bffc0 into main Oct 26, 2023
3 checks passed
@gageorgiev gageorgiev deleted the person/gageorgiev/bound-logger branch October 26, 2023 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants