File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -516,6 +516,17 @@ def parse_args():
516
516
return parser .parse_args ()
517
517
518
518
519
+ def setup_logging (log_directory ):
520
+ if sys .stderr .isatty ():
521
+ logging .basicConfig (format = "%(levelname)s:%(message)s" , stream = sys .stderr )
522
+ else :
523
+ logging .basicConfig (
524
+ format = "%(levelname)s:%(asctime)s:%(message)s" ,
525
+ filename = os .path .join (log_directory , "docsbuild.log" ),
526
+ )
527
+ logging .root .setLevel (logging .DEBUG )
528
+
529
+
519
530
def main ():
520
531
args = parse_args ()
521
532
if args .version :
@@ -527,14 +538,7 @@ def main():
527
538
args .build_root = os .path .abspath (args .build_root )
528
539
if args .www_root :
529
540
args .www_root = os .path .abspath (args .www_root )
530
- if sys .stderr .isatty ():
531
- logging .basicConfig (format = "%(levelname)s:%(message)s" , stream = sys .stderr )
532
- else :
533
- logging .basicConfig (
534
- format = "%(levelname)s:%(asctime)s:%(message)s" ,
535
- filename = os .path .join (args .log_directory , "docsbuild.log" ),
536
- )
537
- logging .root .setLevel (logging .DEBUG )
541
+ setup_logging (args .log_directory )
538
542
venv = os .path .join (args .build_root , "venv" )
539
543
if args .branch :
540
544
branches_to_do = [
You can’t perform that action at this time.
0 commit comments