Skip to content

Commit

Permalink
Add json output.
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyjclark committed Jul 16, 2024
1 parent 7d8a52f commit dde6b68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ python -m pip install .
2. Have `add_*` automatically create the initial frame?
3. Make all parameters to `add_*` optional.
4. Automatically update first frame if subsequent frame changes position, rotation, scale, etc.
5. Add ability to change color and visibility of objects (add to player).
4 changes: 4 additions & 0 deletions reviewlogger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def to_string(self, compact=False):
else:
return json.dumps(self.log_data, sort_keys=True, indent=4)

def to_json(self):
"""Convert logged data to a json object."""
return self.log_data

def __str__(self):
"""Convert logged data to a string."""
return self.to_string()

0 comments on commit dde6b68

Please sign in to comment.