Skip to content

Stop mutating string literal in debug logging - #2530

Merged
tf merged 1 commit into
codevise:masterfrom
tf:frozen-backtrace-logging
Nov 18, 2026
Merged

tf merged 1 commit into
codevise:masterfrom
tf:frozen-backtrace-logging

Conversation

@tf

@tf tf commented Nov 18, 2026

Copy link
Copy Markdown
Member

Appending backtrace lines to a string literal emits a "literal string
will be frozen in the future" warning on Ruby 3.4 each time a
controller rescues a not found record, a missing format, an access
denied error or an invalid state transition. These warnings show up
in the spec output of host applications. Once string literals are
frozen by default, logging the backtrace would raise a FrozenError
from within the error handler.

Joining the lines also separates them by newlines in the log instead
of running them together.

Appending backtrace lines to a string literal emits a "literal string
will be frozen in the future" warning on Ruby 3.4 each time a
controller rescues a not found record, a missing format, an access
denied error or an invalid state transition. These warnings show up
in the spec output of host applications. Once string literals are
frozen by default, logging the backtrace would raise a FrozenError
from within the error handler.

Joining the lines also separates them by newlines in the log instead
of running them together.
@tf tf added this to the v17.3 milestone Nov 18, 2026
@tf
tf merged commit 3072ee4 into codevise:master Nov 18, 2026
16 checks passed
@tf
tf deleted the frozen-backtrace-logging branch November 18, 2026 13:35
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.

1 participant