Skip to content

Debug log on task refresh are somewhat misleading #59

@thomas-riccardi

Description

@thomas-riccardi
DEBUG:deepomatic.api.resources.task:Refreshing Task <Task object id=343279235 at 0x7fdbac121908> JSON: {
    "error": null,
    "id": "343279235",
    "data": null,
}

this log is strange: we log the full old state just before refreshing, but not after refreshing.
I would expect the reverse (or maybe both):
just DEBUG:deepomatic.api.resources.task:Refreshing Task 343279235... with no json.
then after refresh DEBUG:deepomatic.api.resources.task:Task 343279235 refreshed : <Task object id=343279235 at 0x7fdbac121908> JSON {...}

Also:

  • maybe no need to log object address, the task id is unique enough already I think.
  • the JSON could be logged in one line, it would hopefully avoid logs mixing (it happens at least with pytest)
  • maybe s/JSON/data
  • maybe don't log everything in task str ? for example if we log after get task success we may have a large data in there.
  • status is the most important thing after id to be printed

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions