Skip to content
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

Fix rails 7.1 deprecation warning #1038

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mark-young-atg
Copy link

@mark-young-atg mark-young-atg commented Oct 24, 2023

This PR addresses the following Rails 7.1 deprecation warnings.

DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed in Rails 7.2. Use an option hash instead (eg. `color("my text", :red, bold: true)`)
DEPRECATION WARNING: BOLD is deprecated! Use MODES[:bold] instead.

Below is the output from the original code and the code that replaces it. Where the original code provided BOLD as the second argument it was generating the bold terminal escape sequence ("\e[1m") twice which was not achieving anything in addition to turning on bold.

 Original: color(event.payload[:path], BOLD, true)      => "\e[1m\e[1mupdate\e[0m"
Suggested: color(event.payload[:path], nil, bold: true) => "\e[1mupdate\e[0m"
 Original: color(name, GREEN, true)       => "\e[1m\e[32mSOLR Request (21.4ms)\e[0m"
Suggested: color(name, GREEN, bold: true) => "\e[1m\e[32mSOLR Request (21.4ms)\e[0m"

@cedvw
Copy link

cedvw commented Nov 13, 2023

Is there anything we can do to fast track this PR merge? Our logs are flooded with deprecation warnings since we upgraded to Rails 7.1.

This is a trivial fix with no breaking changes.

This PR addresses the following Rails 7.1 deprecation warnings.

```
DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed in Rails 7.2. Use an option hash instead (eg. `color("my text", :red, bold: true)`)
DEPRECATION WARNING: BOLD is deprecated! Use MODES[:bold] instead.
```

Below is the output from the original code and the code that replaces it.
Where the original code provided `BOLD` as the second argument it was
generating the bold terminal escape sequence, '\e[1m`, twice which was
not achieving anything in addition to turning on bold.

 Original: color(event.payload[:path], BOLD, true)      => "\e[1m\e[1mupdate\e[0m"
Suggested: color(event.payload[:path], nil, bold: true) => "\e[1mupdate\e[0m"

 Original: color(name, GREEN, true)       => "\e[1m\e[32mSOLR Request (21.4ms)\e[0m"
Suggested: color(name, GREEN, bold: true) => "\e[1m\e[32mSOLR Request (21.4ms)\e[0m"
@mark-young-atg
Copy link
Author

I have just rebased this with master. No changes were required. The file affected by this change hasn't been touched for 11 years.

Would it be possible to trigger the merge checks so we can see if the tests pass across all the platform configurations?

@shtirlic
Copy link

+1 to this

@tatarsky-v
Copy link

+1

1 similar comment
@daniel88m
Copy link

+1

@zak
Copy link

zak commented Mar 28, 2024

+1
ASAP need fix

@gordienko
Copy link

+1

1 similar comment
@fredberger
Copy link

+1

@shtirlic
Copy link

ping

@shtirlic
Copy link

Dear anyone in the org, plz help @alindeman, @ghempton , @nz, @outoftime , @runlevel5 , @rywall, @vanstee

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.

None yet

8 participants