Fixes + logger.conf

This commit is contained in:
Clinton Hall 2013-02-17 11:08:59 +10:30
commit a00a7e9d7e
3 changed files with 30 additions and 31 deletions

View file

@ -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
@ -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
View 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

View file

@ -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