test
This commit is contained in:
parent
9e6ae6179a
commit
25d1e24b46
@ -4,24 +4,25 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
SCRIPT_PATH = os.path.realpath(__file__)
|
||||||
|
SCRIPT_DIR = os.path.dirname(SCRIPT_PATH)
|
||||||
|
|
||||||
script_settings = {
|
script_settings = {
|
||||||
"tdarr": {
|
"tdarr": {
|
||||||
"url": "http://tdarr-server1.ipa.dbb:8265/api/v2/scan-files",
|
"url": "http://tdarr-server1.ipa.dbb:8265/api/v2/scan-files",
|
||||||
"dbID": "fGxwT-ws7"
|
"dbID": "fGxwT-ws7"
|
||||||
},
|
},
|
||||||
"logging": {
|
"logging": {
|
||||||
"logfile": True,
|
"log_file": True,
|
||||||
|
"log_file_path": os.path.join(SCRIPT_DIR, "log.log"),
|
||||||
"output_level": 1
|
"output_level": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def loggit(logtext):
|
def loggit(logtext):
|
||||||
if script_settings["logging"]["logfile"]:
|
if script_settings["logging"]["log_file"]:
|
||||||
SCRIPT_PATH = os.path.realpath(__file__)
|
with open(script_settings["logging"]["log_file_path"], 'a') as logwrite:
|
||||||
SCRIPT_DIR = os.path.dirname(SCRIPT_PATH)
|
|
||||||
log_file = os.path.join(SCRIPT_DIR, "testlog.log")
|
|
||||||
with open(log_file, 'a') as logwrite:
|
|
||||||
logwrite.write(logtext)
|
logwrite.write(logtext)
|
||||||
if script_settings["logging"]["output_level"]:
|
if script_settings["logging"]["output_level"]:
|
||||||
sys.stderr.write(logtext)
|
sys.stderr.write(logtext)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user