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
feat: record source locations #254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it working for all environments?
user_labels = getattr(record, "labels", {}) | ||
# merge labels | ||
total_labels = self.labels if self.labels is not None else {} | ||
total_labels.update(user_labels) | ||
if len(total_labels) == 0: | ||
total_labels = None | ||
# create source location object | ||
if record.lineno and record.funcName and record.pathname: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can some of the 3 be empty? For example, code that's not part of any function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these are all part of the official record
object spec, so the attributes will all exist.
They could be None
, but that would be caught by this check
environments using the new CloudLoggingFilter will now capture source locations when sending logs to GCP
This feature will currently not work in GAE and GKE environments. Those use custom handlers, which I want to keep those consistent until 3.0.0 is released