TaskFormatter
Formatter for tasks, adding the task name and id.
Methods
format()
@classmethod
def format(
record: LogRecord
) - > string
Formats the specified log record by injecting the current Celery task's name and ID into the record's attributes. This ensures that log messages include task-specific context for easier debugging and tracking of asynchronous executions.
Parameters
| Name | Type | Description |
|---|---|---|
| record | LogRecord | The logging record object containing the message and metadata to be formatted. |
Returns
| Type | Description |
|---|---|
string | The formatted log message string, including task metadata and colorization from the parent formatter. |