Skip to content

refactor: remove dead setup_events_logger helper and unused events.log handler#709

Merged
anderdc merged 7 commits intoentrius:testfrom
bittoby:refactor/remove-dead-events-logger
Apr 23, 2026
Merged

refactor: remove dead setup_events_logger helper and unused events.log handler#709
anderdc merged 7 commits intoentrius:testfrom
bittoby:refactor/remove-dead-events-logger

Conversation

@bittoby
Copy link
Copy Markdown
Contributor

@bittoby bittoby commented Apr 22, 2026

Summary

Removes setup_events_logger() from gittensor/utils/logging.py and its single call site in check_config(). The helper ran on every validator startup, monkey-patching logging.Logger.event onto the stdlib Logger class and opening a RotatingFileHandler on events.log, but nothing in the repository ever calls .event().

Normal bt.logging.* calls and the bittensor.log rotating file are unaffected - those flow through bittensor's LoggingMachine, not through the removed helper.

Related Issues

Closes #708

Type of Change

  • Bug fix
  • Refactor
  • New feature
  • Documentation
  • Other (describe below)

Testing

  • Tests added/updated
  • Manually tested

Full test suite passes (410 tests). ruff check, ruff format, and pyright all clean.

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

@xiao-xiao-mao xiao-xiao-mao Bot added the refactor Code restructuring without behavior change label Apr 22, 2026
@bittoby
Copy link
Copy Markdown
Contributor Author

bittoby commented Apr 23, 2026

@anderdc would you please review this PR?

Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

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

Cleanup is incomplete — the CLI surface for the removed feature is still registered. Please also drop the two orphan add_argument blocks in gittensor/utils/config.py:

  • --neuron.events_retention_size (lines 80-85)
  • --neuron.dont_save_events (lines 87-92)

Nothing consumes them after this PR, so they'd just show up in --help and silently accept values that do nothing.

@bittoby
Copy link
Copy Markdown
Contributor Author

bittoby commented Apr 23, 2026

@anderdc Updated!

@bittoby bittoby requested a review from anderdc April 23, 2026 18:37
@anderdc anderdc merged commit 0ecafea into entrius:test Apr 23, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup_events_logger is dead template code - never used

2 participants