# gpui: Add track_caller to gpui_util::log_err \(\#62538\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fc952d52dab0920732b01d031d7324e664e6734f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fc952d52dab0920732b01d031d7324e664e6734f

Requested commit: fc952d52dab0920732b01d031d7324e664e6734f

Commit: fc952d52dab0920732b01d031d7324e664e6734f

Tree: 26f5c6407c02a1a1a8e9ce90abd3bb613b937fd3

Author: Mattia Schiano

Committer: GitHub

## Message

```
gpui: Add track_caller to gpui_util::log_err (#62538)

# Objective

Tiny annoyance, the standalone `gpui_util::log_err` was never annotated
with `#[track_caller]` so whenever it was called, the source location
would be `gpui_util::lib` instead of the appropriate location.

I checked and this is actually used in Zed in exactly one place:
`crates/extension_host/src/extension_host.rs:1095`. So *technically*
this can be considered a bug.

I use it quite frequently in my code, so this is more of a self-serving
pr.

## Solution

I added `#[track_caller]` to `gpui_util::log_err`.

## Testing

I ran the tests just in case and they all passed.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added track_caller to gpui_util::log_err
```

## Parents

- [93f6b2e59725de4ac54c73867f69d3bb00091673](https://git.cafe/gitcafe/zed/commit/93f6b2e59725de4ac54c73867f69d3bb00091673?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fc952d52dab0920732b01d031d7324e664e6734f?format=markdown)
