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

Add Python logging with same format as Java #360

Merged
merged 1 commit into from
Sep 6, 2023
Merged

Conversation

cbornet
Copy link
Member

@cbornet cbornet commented Sep 6, 2023

Fix #346

Copy link
Member

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

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

How the custom processor should call the logger?

@cbornet
Copy link
Member Author

cbornet commented Sep 6, 2023

The processor can use logging.info or it's own logger. Eg:

import logging
logging.info("hello") # uses the root logger

LOG = logging.getLogger(__name__) # uses a logger with the module name
LOG.info("world")

Copy link
Member

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

+1

we need to add a section to the docs here

@eolivelli eolivelli merged commit f1a1a22 into main Sep 6, 2023
8 checks passed
@eolivelli eolivelli deleted the python-logging branch September 6, 2023 12:24
@cbornet
Copy link
Member Author

cbornet commented Sep 6, 2023

we need to add a section to the docs here

Sure. Note that logging is built-in in Python. So there is no surprise here for Python devs.

benfrank241 pushed a commit to vectorize-io/langstream that referenced this pull request May 2, 2024
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.

Configure Python log format to be coherent with Java
3 participants