Skip to content

Tags: multani/structlog-gcp

Tags

v0.5.0

Toggle v0.5.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix error reporting formatting (#98)

The stacktrace for an error was formatted as:

    ${message}
    ${stacktrace}

I'm pretty sure I saw that documented in Google Cloud's documentation
when I initially implemented this feature, but I can't find it anymore
and the current documentation from
https://cloud.google.com/error-reporting/docs/formatting-error-messages#log-error
now says:

> To log an error event that is a stack trace, write the error event as
> one of these types:
> [...]
>
> * A `jsonPayload` that includes a `message`, `stack_trace`, or
>   `exception` field.
>
>   You can specify more than one of those fields. If more than one of
>   those fields is specified, then the order of evaluation is: `stack_trace`,
>   then `exception`, and then `message`.
>
>   If the `message` field is evaluated and if it isn't empty, then the
>   stack trace is captured only when the field contains a stack trace in
>   one of the supported programming language formats. The stack trace isn't
>   captured by Error Reporting when an unsupported format is used.
>
>   If your error event is formatted as a `ReportedErrorEvent` object,
>   then copy its fields to the `jsonPayload`. For more information and an
>   example, see Log an error that is formatted as a ReportedErrorEvent
>   object.

There's no mention of this weird `${message}\n${stacktrace}` anymore, so
let's get rid of it.

v0.4.0

Toggle v0.4.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Allow to override the log level while logging exceptions (#79)

While logging information during an exception `except` block, instead of
overwriting the log level with `CRITICAL`, the log level used by the
caller will be set instead.

This allows the caller to use:

```python
try:
    raise ValueError()
except Exception as exc:
    logger.info(f"I was expecting this error: {exc}")
```

The log message will be logged as `INFO` level, whereas it was logged as
`CRITICAL` before.

If an `exception` attribute is still passed to the logger, as in
`logger.info("something", exception=exc)`, the log level will be `INFO`
as expected but the error will also still be correctly reported (in
Error Reporting + the bubble in Cloud Logging)

v0.3.0

Toggle v0.3.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Document `structlog_gcp.build_processors` (#44)

v0.2.6

Toggle v0.2.6's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Build/test with multiple Python versions (#40)

v0.2.5

Toggle v0.2.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Use uv to install dev dependencies and build (#38)

v0.2.4

Toggle v0.2.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Split out the JSON renderer from the Cloud Logging formatter (#30)

This separates the concern a bit more and allow to configure specific
JSON renderer when there's a need to.

v0.2.3

Toggle v0.2.3's commit message

Verified

This commit was signed with the committer’s verified signature.
multani Jonathan Ballet
Fix fetching the version during release

v0.2.2

Toggle v0.2.2's commit message

Verified

This commit was signed with the committer’s verified signature.
multani Jonathan Ballet
Actually deploy on releases

v0.2.1

Toggle v0.2.1's commit message

Verified

This commit was signed with the committer’s verified signature.
multani Jonathan Ballet
Release v0.2.1

v0.2.0

Toggle v0.2.0's commit message

Verified

This commit was signed with the committer’s verified signature.
multani Jonathan Ballet
Release v0.2.0