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 bug that "trace line" does not work after stopping trace once #915

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

ono-max
Copy link
Member

@ono-max ono-max commented Mar 6, 2023

No description provided.

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

Good catch on this 👍
I think the method could be simplified as:

    def add_tracer tracer
      if @tracers[tracer.key]&.enabled?
        tracer.disable
        @ui.puts "Duplicated tracer: #{tracer}"
      else
        @tracers[tracer.key] = tracer
        @ui.puts "Enable #{tracer}"
      end
    end

tracer.disable
@ui.puts "Duplicated tracer: #{tracer}"
else
@tracers[tracer.key].enable
Copy link
Member

Choose a reason for hiding this comment

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

Since the argument tracer is already enabled, I think this will accidentally enable the existing tracer, so we'll have 2 similar tracers both enabled.

@ono-max
Copy link
Member Author

ono-max commented Mar 7, 2023

Thank you for your suggestion. I've updated it.

@ko1 ko1 merged commit bd9a3be into ruby:master Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants