mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-26 09:37:25 +00:00
Fix for logging before creating log directory on new install.
This commit is contained in:
parent
74b2787ac3
commit
c81da4aa7e
2 changed files with 7 additions and 11 deletions
|
@ -1,7 +1,6 @@
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import logging
|
|
||||||
import time
|
import time
|
||||||
import rarfile
|
import rarfile
|
||||||
|
|
||||||
|
@ -9,6 +8,7 @@ from cork import Cork
|
||||||
from ConfigParser2 import ConfigParser
|
from ConfigParser2 import ConfigParser
|
||||||
from config import settings
|
from config import settings
|
||||||
from get_args import args
|
from get_args import args
|
||||||
|
from logger import configure_logging
|
||||||
|
|
||||||
from dogpile.cache.region import register_backend as register_cache_backend
|
from dogpile.cache.region import register_backend as register_cache_backend
|
||||||
import subliminal
|
import subliminal
|
||||||
|
@ -33,24 +33,21 @@ if not os.path.exists(args.config_dir):
|
||||||
# Create config_dir directory tree
|
# Create config_dir directory tree
|
||||||
try:
|
try:
|
||||||
os.mkdir(os.path.join(args.config_dir))
|
os.mkdir(os.path.join(args.config_dir))
|
||||||
logging.debug("BAZARR Created data directory")
|
|
||||||
except OSError:
|
except OSError:
|
||||||
logging.exception(
|
print "BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?)."
|
||||||
"BAZARR The configuration directory doesn't exist and Bazarr cannot create it (permission issue?).")
|
|
||||||
exit(2)
|
exit(2)
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(args.config_dir, 'config')):
|
if not os.path.exists(os.path.join(args.config_dir, 'config')):
|
||||||
os.mkdir(os.path.join(args.config_dir, 'config'))
|
os.mkdir(os.path.join(args.config_dir, 'config'))
|
||||||
logging.debug("BAZARR Created config folder")
|
|
||||||
if not os.path.exists(os.path.join(args.config_dir, 'db')):
|
if not os.path.exists(os.path.join(args.config_dir, 'db')):
|
||||||
os.mkdir(os.path.join(args.config_dir, 'db'))
|
os.mkdir(os.path.join(args.config_dir, 'db'))
|
||||||
logging.debug("BAZARR Created db folder")
|
|
||||||
if not os.path.exists(os.path.join(args.config_dir, 'log')):
|
if not os.path.exists(os.path.join(args.config_dir, 'log')):
|
||||||
os.mkdir(os.path.join(args.config_dir, 'log'))
|
os.mkdir(os.path.join(args.config_dir, 'log'))
|
||||||
logging.debug("BAZARR Created log folder")
|
|
||||||
if not os.path.exists(os.path.join(args.config_dir, 'cache')):
|
if not os.path.exists(os.path.join(args.config_dir, 'cache')):
|
||||||
os.mkdir(os.path.join(args.config_dir, 'cache'))
|
os.mkdir(os.path.join(args.config_dir, 'cache'))
|
||||||
logging.debug("BAZARR Created cache folder")
|
|
||||||
|
configure_logging(settings.general.getboolean('debug') or args.debug)
|
||||||
|
import logging
|
||||||
|
|
||||||
# create database file
|
# create database file
|
||||||
if not os.path.exists(os.path.join(args.config_dir, 'db', 'bazarr.db')):
|
if not os.path.exists(os.path.join(args.config_dir, 'db', 'bazarr.db')):
|
||||||
|
|
|
@ -25,12 +25,11 @@ import operator
|
||||||
from calendar import day_name
|
from calendar import day_name
|
||||||
|
|
||||||
from get_args import args
|
from get_args import args
|
||||||
from logger import configure_logging, empty_log
|
from logger import empty_log
|
||||||
from config import settings, url_sonarr, url_radarr, url_radarr_short, url_sonarr_short, base_url
|
from config import settings, url_sonarr, url_radarr, url_radarr_short, url_sonarr_short, base_url
|
||||||
|
|
||||||
configure_logging(settings.general.getboolean('debug') or args.debug)
|
|
||||||
|
|
||||||
from init import *
|
from init import *
|
||||||
|
import logging
|
||||||
from database import database, dict_mapper
|
from database import database, dict_mapper
|
||||||
|
|
||||||
from notifier import update_notifier
|
from notifier import update_notifier
|
||||||
|
|
Loading…
Reference in a new issue