Description
NetBox version
v4.0.3
Feature type
Change to existing functionality
Proposed functionality
Make log_success(None, None)
and/or log_success("", None)
increment the success counter without generating a log message
Use case
Reports in Netbox <= v3.7 were able to do this:
self.log_success(obj)
This would increment the success counter for the report without generating any message: e.g.

However, in Netbox 4.0, when upgrading a Report to a Script, you need to change it to:
self.log_success("", obj)
or
self.log_success(None, obj)
or
self.log_success(None, None)
All of these log a message: a dash in the first case, or the string "None" in the second and third. (The third log line has no URL).
Either way, if you have thousands of successful checks, this generates thousands of log lines to wade through.
I note from the documentation of v3.7 that omitting the message for log_success()
in Reports was explicitly permitted, and defaulted to None
:
* log(message)
* log_success(object, message=None)
* log_info(object, message)
* log_warning(object, message)
* log_failure(object, message)
Maybe also log_success()
with no arguments should be allowed, since the object identity isn't actually being used if no message is being recorded. It would be equivalent to log_success(None, None)
Possibly relates to #8984, although I think that this feature request is orthogonal.
Database changes
None
External dependencies
None