-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
NetBox version
v4.3.3
Feature type
New functionality
Proposed functionality
Add to the JobRunner class a log()
mechanism which can be used to record arbitrary log messages during job execution. These messages will be stored separately from job data. Each log message should include:
- Timestamp
- Level (see below)
- Message
Supported levels should include the following, which map directly to native Python logging levels:
- Debug
- Info (default)
- Warning
- Error
(Note that these levels are not to be confused with the levels support for custom script logging, which differ in the nature of their use.)
Use case
This would provide a convenient, persistent mechanism to record log messages during the execution of a job, without requiring the job's author to devise a custom implementation.
Database changes
Add a log
field to the Job model. This could be a JSONField or an ArrayField, depending on how we structure the data.
External dependencies
N/A