소스 검색

Merge pull request #21289 from llamafilm/20052-loglevel

Fixes #20052: improve logging for faulty scripts
bctiemann 4 달 전
부모
커밋
5338c842b8
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/extras/models/scripts.py
  2. 1 0
      netbox/templates/extras/inc/script_list_content.html

+ 1 - 1
netbox/extras/models/scripts.py

@@ -137,7 +137,7 @@ class ScriptModule(PythonModuleMixin, JobsMixin, ManagedFile):
             module = self.get_module()
         except Exception as e:
             self.error = e
-            logger.debug(f"Failed to load script: {self.python_name} error: {e}")
+            logger.error(f"Failed to load script: {self.python_name} error: {e}")
             module = None
 
         scripts = {}

+ 1 - 0
netbox/templates/extras/inc/script_list_content.html

@@ -121,6 +121,7 @@
           <div class="alert alert-warning" role="alert">
             <i class="mdi mdi-alert"></i>
             {% blocktrans with module=module.name %}Could not load scripts from module {{ module }}{% endblocktrans %}
+            {% if module.error %}<code>{{ module.error }}</code>{% endif %}
           </div>
         </div>
       {% endif %}