mirror of
https://github.com/aljazceru/nostrdvm.git
synced 2025-12-23 17:04:27 +01:00
introduce loglevels to reduce logging on demand, improve wot
This commit is contained in:
@@ -8,7 +8,7 @@ import sys
|
||||
from sys import platform
|
||||
from threading import Thread
|
||||
from venv import create
|
||||
from nostr_sdk import Keys, Kind
|
||||
from nostr_sdk import Keys, Kind, LogLevel
|
||||
from nostr_dvm.dvm import DVM
|
||||
from nostr_dvm.utils.admin_utils import AdminConfig
|
||||
from nostr_dvm.utils.dvmconfig import DVMConfig, build_default_config
|
||||
@@ -17,6 +17,7 @@ from nostr_dvm.utils.nip89_utils import NIP89Config, check_and_set_d_tag
|
||||
from nostr_dvm.utils.output_utils import post_process_result
|
||||
|
||||
|
||||
|
||||
class DVMTaskInterface:
|
||||
NAME: str
|
||||
KIND: Kind
|
||||
@@ -136,12 +137,13 @@ class DVMTaskInterface:
|
||||
return post_process_result(result, event)
|
||||
|
||||
def set_options(self, request_form):
|
||||
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] " + "Setting options...")
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] " + "Setting options...")
|
||||
opts = []
|
||||
if request_form.get("options"):
|
||||
opts = json.loads(request_form["options"])
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] " + str(opts))
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] " + str(opts))
|
||||
return dict(opts)
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user