aop.ipc: Use print as default logger

Signed-off-by: Eileen Yoon <eyn@gmx.com>
This commit is contained in:
Eileen Yoon 2024-01-30 09:55:33 +09:00 committed by Hector Martin
parent 33c4591ff3
commit 0ebc339761

View file

@ -44,9 +44,7 @@ class EPICCall:
def from_stream(cls, f): def from_stream(cls, f):
return cls(cls.ARGS.parse_stream(f)) return cls(cls.ARGS.parse_stream(f))
def dump(self, logger=None): def dump(self, logger=print):
if logger is None:
logger = print
args_fmt = [f"{k}={v}" for (k, v) in self.args.items() if k != "_io"] args_fmt = [f"{k}={v}" for (k, v) in self.args.items() if k != "_io"]
rets_fmt = [f"{k}={v}" for (k, v) in self.rets.items() if k != "_io"] rets_fmt = [f"{k}={v}" for (k, v) in self.rets.items() if k != "_io"]
logger(f"{type(self).__name__}({', '.join(args_fmt)}) -> ({', '.join(rets_fmt)})") logger(f"{type(self).__name__}({', '.join(args_fmt)}) -> ({', '.join(rets_fmt)})")