Skip to content

Logger's receiverThread can't be recovered after calling end(). #187

@BraedenHunt

Description

@BraedenHunt

Describe the bug
The org.littletonrobotics.junction.Logger class uses a ReceiverThread and starts in it start() and terminates it in end(). Once terminated, the thread can't be recreated and would need to be reinitialized. Because it is initialized as a private static final field, it can't be reinitialized, and therefore, Logger can't be reused after Logger.end() is called, such as through the LoggedRobot.endCompetition() method. This makes automated end-to-end integration tests unpractical.

Expected behavior
Calling Logger.start() should create a new instance of the receiverThread for reuse in automated testing.

Version (required):

  • OS: Windows 10
  • Project Information:
    • Project Version: 2025.2.1
    • VS Code Version: 1.96.2
    • WPILib Extension Version: 2025.2.1
    • C++ Extension Version: 1.23.2
    • Java Extension Version: 1.41.0
    • Java Debug Extension Version: 0.58.1
    • Java Dependencies Extension Version 0.24.1
    • Java Version: 17
    • Java Location: C:\Users\Public\wpilib\2025\jdk
    • Vendor Libraries:
      • AdvantageKit (4.1.2)
      • maplesim (0.3.8)
      • PathplannerLib (2025.2.6)
      • CTRE-Phoenix (v6) (25.3.1)
      • photonlib (v2025.2.1)
      • WPILib-New-Commands (1.0.0)

Additional context
I am working on simulating robot code similar to this WPILib example: https://github.com/wpilibsuite/allwpilib/blob/main/wpilibjExamples/src/test/java/edu/wpi/first/wpilibj/examples/armsimulation/ArmSimulationTest.java but am unable to due to Logger not being able to restart properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions