NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
73 stars 19 forks source link

Add streamline Logger #1500

Closed DavidLegg closed 3 months ago

DavidLegg commented 4 months ago

Description

Adds a Logger class to the streamline framework, which uses topics to emit log messages directly as events. Also builds such a Logger when the Registrar is initialized, and reconfigures errors to go to that logger when the error behavior is set to LOG. Before this, errors were collected awkwardly into a discrete string resource.

Verification

Since the logger is connected to the Registrar's error behavior, this was tested using the streamline-demo example model. By adding "CauseError" activities to the plan, we can trip the resource error handling machinery, and verify that appropriate error messages appear in the Simulation Events tab.

image

Documentation

None yet - #1494 should probably be updated to tell users how to use the logger in their model/activities.

This does remove the errors resource, but it leaves the numberOfErrors resource intact, which we should note for any users who may have depended on errors.

Future work

None planned

DavidLegg commented 3 months ago

One slight correction to that note on the errors and numberOfErrors resources - We actually had numberOfErrors already, just derived in a different way. This PR does remove errors itself, though, so I agree we should put that in the release notes just in case.