You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/customization/custom-scripts.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,11 +138,11 @@ These two methods will load data in YAML or JSON format, respectively, from file
138
138
139
139
The Script object provides a set of convenient functions for recording messages at different severity levels:
140
140
141
-
*`log_debug(message, obj=None)`
142
-
*`log_success(message, obj=None)`
143
-
*`log_info(message, obj=None)`
144
-
*`log_warning(message, obj=None)`
145
-
*`log_failure(message, obj=None)`
141
+
*`log_debug(message=None, obj=None)`
142
+
*`log_success(message=None, obj=None)`
143
+
*`log_info(message=None, obj=None)`
144
+
*`log_warning(message=None, obj=None)`
145
+
*`log_failure(message=None, obj=None)`
146
146
147
147
Log messages are returned to the user upon execution of the script. Markdown rendering is supported for log messages. A message may optionally be associated with a particular object by passing it as the second argument to the logging method.
148
148
@@ -152,6 +152,8 @@ A script can define one or more test methods to report on certain conditions. Al
152
152
153
153
These methods are detected and run automatically when the script is executed, unless its `run()` method has been overridden. (When overriding `run()`, `run_tests()` can be called to run all test methods present in the script.)
154
154
155
+
Calling any of these logging methods without a message will increment the relevant counter, but will not generate an output line in the script's log.
156
+
155
157
!!! info
156
158
This functionality was ported from [legacy reports](./reports.md) in NetBox v4.0.
0 commit comments