diff --git a/piker/accounting/_pos.py b/piker/accounting/_pos.py index 724b357f..e7f83d98 100644 --- a/piker/accounting/_pos.py +++ b/piker/accounting/_pos.py @@ -26,6 +26,7 @@ from __future__ import annotations from contextlib import contextmanager as cm from decimal import Decimal from math import copysign +from pprint import pformat import re from typing import ( Any, @@ -88,6 +89,9 @@ class Position(Struct): expiry: Optional[datetime] = None + def __repr__(self) -> str: + return pformat(self.to_dict()) + def to_dict(self) -> dict: return { f: getattr(self, f) @@ -657,7 +661,7 @@ class PpTable(Struct): if pp_entries: log.info( f'Updating ``pps.toml``:\n' - f'Current positions:\n{pp_entries}' + f'Current positions:\n{pformat(pp_entries)}' ) self.conf[self.brokername][self.acctid] = pp_entries