use os.makedirs with exist_ok to create log directory
Should fix LP: #1617236
This commit is contained in:
parent
69ab3ef696
commit
f79c82a367
|
@ -25,8 +25,7 @@ LOGFILE = os.path.join(LOGDIR, "subiquity-debug.log")
|
|||
def setup_logger(name=__name__, dir=LOGDIR):
|
||||
LOGFILE = os.path.join(dir, "subiquity-debug.log")
|
||||
try:
|
||||
if not os.path.isdir(dir):
|
||||
os.makedirs(dir)
|
||||
os.makedirs(dir, exist_ok=True)
|
||||
log = TimedRotatingFileHandler(LOGFILE,
|
||||
when='D',
|
||||
interval=1,
|
||||
|
|
Loading…
Reference in New Issue