nautobot / nautobot

Network Source of Truth & Network Automation Platform
https://docs.nautobot.com
Apache License 2.0
1.01k stars 268 forks source link

Jobs Overhaul: Allow setting a log level on a per job basis #2071

Open Kircheneer opened 2 years ago

Kircheneer commented 2 years ago

Blocked by #2331

As ...

P.D. - Plugin Developer

I want ...

Jobs to have the possibility of setting a log level.

So that ...

The job log entry database table doesn't grow as big and the logs are a little tidier implicitly, rather than me having to implement this for every job I build.

I know this is done when...

There is a possibility to set a log level per job that limits which calls to self.log_* actually do get logged.

Optional - Feature groups this request pertains to.

Database Changes

None.

External Dependencies

None.

lampwins commented 2 years ago

The debug flag itself is specific to a variable that has been added to certain SSoT jobs. That said, we can refactor this story such that an admin could set a log level on the job model, which would affect the types of log messages that are emitted.

Kircheneer commented 2 years ago

Oh alright, thanks for clarifying. Your suggestion makes even more sense anyway. I have updated the issue to reflect this.

Should there be an admin-set default that users can override in case they need to debug specific jobs?