From cfc87a7056a63c8466d6dedd9bc6d0a895bac3dc Mon Sep 17 00:00:00 2001 From: Julio-Oliveira-Encora Date: Mon, 10 Jun 2024 10:41:47 -0300 Subject: [PATCH] Addressed PR comment. --- docs/customization/custom-scripts.md | 2 +- docs/customization/reports.md | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/customization/custom-scripts.md b/docs/customization/custom-scripts.md index 2a8f252aa..870d20c2c 100644 --- a/docs/customization/custom-scripts.md +++ b/docs/customization/custom-scripts.md @@ -139,7 +139,7 @@ These two methods will load data in YAML or JSON format, respectively, from file The Script object provides a set of convenient functions for recording messages at different severity levels: * `log_debug(message, object=None)` -* `log_success(message, object=None)` +* `log_success(message=None, object=None)` * `log_info(message, object=None)` * `log_warning(message, object=None)` * `log_failure(message, object=None)` diff --git a/docs/customization/reports.md b/docs/customization/reports.md index f7eef506d..d40db650f 100644 --- a/docs/customization/reports.md +++ b/docs/customization/reports.md @@ -54,6 +54,15 @@ self.log_failure( ) ``` +### Logging Success Note +If you want to increase the success counter without generating a log message, choose one of the following options: + +```python +log_success(None, None) +log_success("", None) +log_sucess() +``` + ### Other Notes Existing reports will be converted to scripts automatically upon upgrading to NetBox v4.0, and previous job history will be retained. However, users are advised to convert legacy reports into custom scripts at the earliest opportunity, as support for legacy reports will be removed in a future release.