Previously the code was spread out through the `TaskRunner` and `AbstractCommand` classes. Now it's in a class of its own and properly tested. Also, the timing info is now sent as one line in the task log, making it less spammy.
11 lines
212 B
Python
11 lines
212 B
Python
import json
|
|
|
|
from . import timing
|
|
|
|
|
|
class JSONEncoder(json.JSONEncoder):
|
|
def default(self, o):
|
|
if isinstance(o, timing.Timing):
|
|
return o.to_json_compat()
|
|
return super().default(o)
|