-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add streamline Logger #1500
Add streamline Logger #1500
Conversation
1e6fe63
to
a5a577f
Compare
a5a577f
to
1ebe02d
Compare
9d57c41
to
b64bb1e
Compare
contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/debugging/Logger.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/Registrar.java
Outdated
Show resolved
Hide resolved
53d36cb
to
efecb61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making this backwards compatible! Looks good to me
EDIT: Resolving conversation below so it doesn't block merge, but copying up here for visibility:
In the event that users have written constraints that depend on the previous resource definition, it may be worth calling out in the release notes [that the errors resources has been replaced with a numberOfErrors resource]. Not a reason not to make this change, but worth communicating explicitly.
contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/modeling/Registrar.java
Show resolved
Hide resolved
One slight correction to that note on the |
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.
Move the primary Logger instance to a separate class, out of Registrar. This makes more sense logically, as Logging only incidentally depends on the Registrar, in the sense that creating the Registrar is a natural place to initialize all of the singletons. It also makes the logger easier to find (I hope).
Per @mattdailis' suggestion, since serialized events are tagged with the time they're emitted already, there's no need to include that information in the log message itself. Further, removing that dependency on the plan start time makes this PR fully backwards-compatible.
efecb61
to
f4ddb29
Compare
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.
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 thenumberOfErrors
resource intact, which we should note for any users who may have depended onerrors
.Future work
None planned