mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-22 06:13:19 -07:00
Fixes + logger.conf
This commit is contained in:
parent
19f2262692
commit
a00a7e9d7e
3 changed files with 30 additions and 31 deletions
|
@ -10,7 +10,7 @@ from nzbToMediaEnv import VERSION
|
||||||
|
|
||||||
Logger = logging.getLogger()
|
Logger = logging.getLogger()
|
||||||
logFile = os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log")
|
logFile = os.path.join(os.path.dirname(sys.argv[0]), "postprocess.log")
|
||||||
logging.config.fileConfig(os.path.join(os.path.dirname(sys.argv[0]), "nzbToMediaEnv.py"))
|
logging.config.fileConfig(os.path.join(os.path.dirname(sys.argv[0]), "logger.conf"))
|
||||||
fileHandler = logging.FileHandler(logFile, encoding='utf-8', delay=True)
|
fileHandler = logging.FileHandler(logFile, encoding='utf-8', delay=True)
|
||||||
fileHandler.formatter = logging.Formatter('%(asctime)s|%(levelname)-7.7s %(message)s', '%H:%M:%S')
|
fileHandler.formatter = logging.Formatter('%(asctime)s|%(levelname)-7.7s %(message)s', '%H:%M:%S')
|
||||||
fileHandler.level = logging.DEBUG
|
fileHandler.level = logging.DEBUG
|
||||||
|
@ -128,10 +128,10 @@ DirBase = os.path.split(os.path.normpath(Directory)) #Test for blackhole sub-dir
|
||||||
if DirBase[1] == Name:
|
if DirBase[1] == Name:
|
||||||
Logger.info("Files appear to be in their own directory")
|
Logger.info("Files appear to be in their own directory")
|
||||||
DirBase2 = os.path.split(os.path.normpath(DirBase[0]))
|
DirBase2 = os.path.split(os.path.normpath(DirBase[0]))
|
||||||
if DirBase2[1] == Movie_Cat or DirBase == TV_Cat:
|
if DirBase2[1] == Movie_Cat or DirBase == TV_Cat:
|
||||||
if not Category:
|
if not Category:
|
||||||
Logger.info("Determined Category to be: %s", DirBase2[1])
|
Logger.info("Determined Category to be: %s", DirBase2[1])
|
||||||
Category = DirBase2[1]
|
Category = DirBase2[1]
|
||||||
|
|
||||||
elif DirBase[1] == Movie_Cat or DirBase == TV_Cat:
|
elif DirBase[1] == Movie_Cat or DirBase == TV_Cat:
|
||||||
if os.path.isdir(os.path.join(Directory, Name)):
|
if os.path.isdir(os.path.join(Directory, Name)):
|
||||||
|
@ -222,7 +222,7 @@ elif useLink == 1 and packed == 0 and video == 1: ## hardlink
|
||||||
source = os.path.join(dirpath, file)
|
source = os.path.join(dirpath, file)
|
||||||
target = os.path.join(destination, file)
|
target = os.path.join(destination, file)
|
||||||
|
|
||||||
if os.name == 'nt'
|
if os.name == 'nt':
|
||||||
subprocess.call(['cmd', '/C', 'mklink', '/H', source, target], stdout=subprocess.PIPE)
|
subprocess.call(['cmd', '/C', 'mklink', '/H', source, target], stdout=subprocess.PIPE)
|
||||||
elif os.name == 'posix':
|
elif os.name == 'posix':
|
||||||
os.link(source, target)
|
os.link(source, target)
|
||||||
|
|
24
logger.conf
Normal file
24
logger.conf
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Logging configuration
|
||||||
|
[loggers]
|
||||||
|
keys = root
|
||||||
|
|
||||||
|
[handlers]
|
||||||
|
keys = console
|
||||||
|
|
||||||
|
[formatters]
|
||||||
|
keys = generic
|
||||||
|
|
||||||
|
[logger_root]
|
||||||
|
level = NOTSET
|
||||||
|
handlers = console
|
||||||
|
qualname =
|
||||||
|
|
||||||
|
[handler_console]
|
||||||
|
class = StreamHandler
|
||||||
|
args = (sys.stdout,)
|
||||||
|
level = INFO
|
||||||
|
formatter = generic
|
||||||
|
|
||||||
|
[formatter_generic]
|
||||||
|
format = %(asctime)s|%(levelname)-7.7s %(message)s
|
||||||
|
datefmt = %H:%M:%S
|
|
@ -1,26 +1 @@
|
||||||
VERSION = 'V4.3'
|
VERSION = 'V4.3'
|
||||||
|
|
||||||
# Logging configuration
|
|
||||||
[loggers]
|
|
||||||
keys = root
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
keys = console
|
|
||||||
|
|
||||||
[formatters]
|
|
||||||
keys = generic
|
|
||||||
|
|
||||||
[logger_root]
|
|
||||||
level = NOTSET
|
|
||||||
handlers = console
|
|
||||||
qualname =
|
|
||||||
|
|
||||||
[handler_console]
|
|
||||||
class = StreamHandler
|
|
||||||
args = (sys.stdout,)
|
|
||||||
level = INFO
|
|
||||||
formatter = generic
|
|
||||||
|
|
||||||
[formatter_generic]
|
|
||||||
format = %(asctime)s|%(levelname)-7.7s %(message)s
|
|
||||||
datefmt = %H:%M:%S
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue