Skip to content

Preserve Toolbox log original log location - #360

Merged
fioan89 merged 3 commits into
mainfrom
fix/toolbox-log-attribution
Sep 10, 2026
Merged

fioan89 merged 3 commits into
mainfrom
fix/toolbox-log-attribution

Conversation

@fioan89

@fioan89 fioan89 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Toolbox logger did a nifty trick in which methods like error, info, debug were inline methods. They managed to capture the business class from which it was called. Once we wrapped the Toolbox logger into our own CoderLogger, the log location always became the CoderLogger. So we did a similar thing.

We inlined the session-aware logger methods so Toolbox attributes each entry to the business caller while keeping popup messages evaluated once.

Toolbox logger did a nifty trick in which methods like error, info, debug were inline methods.
They managed to capture the business class from which it was called. Once we wrapped the Toolbox logger
into our own CoderLogger, the log location always became the CoderLogger. So we did a similar thing.

We inlined the session-aware logger methods so Toolbox attributes each entry to the business caller while keeping popup messages evaluated once.

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nifty indeed!

Comment thread src/test/kotlin/com/coder/toolbox/diagnostics/CoderLoggerTest.kt Outdated
@fioan89
fioan89 merged commit 93a2452 into main Sep 10, 2026
4 checks passed
@fioan89
fioan89 deleted the fix/toolbox-log-attribution branch September 10, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants