@@ -685,15 +685,21 @@ class Configuration:
685
685
686
686
# constructor
687
687
688
- def __init__ (self , config_file , verbose = False , skip_log = False ):
688
+ def __init__ (self , config_file , verbose = False , skip_log = False ,
689
+ disable_auth_log = False ):
689
690
self .config_file = config_file
690
- self .reload_config (verbose , skip_log )
691
-
692
- def reload_config (self , verbose , skip_log = False ):
693
- """Re-read and parse configuration file. Optional skip_log
694
- initializes default logger to use the NullHandler in order to avoid
695
- uninitialized log while not really touching log files or causing stdio
696
- output.
691
+ self .reload_config (verbose , skip_log , disable_auth_log )
692
+
693
+ def reload_config (self , verbose , skip_log = False , disable_auth_log = False ):
694
+ """Re-read and parse configuration file. Optional skip_log arg
695
+ initializes default logger(s) to use the NullHandler in order to
696
+ avoid uninitialized log while not really touching log files or causing
697
+ stdio output. It is mainly used to disable logging to mig.log from
698
+ grid_X daemons, which already set up their own per-daemon log for the
699
+ purpose.
700
+ The optional disable_auth_log is a workaround ONLY to be used inside a
701
+ few unit tests where auth.log is really only in the way. It should
702
+ NEVER be set in code used for production.
697
703
"""
698
704
699
705
try :
@@ -2486,17 +2492,14 @@ def reload_config(self, verbose, skip_log=False):
2486
2492
2487
2493
# Init auth logger
2488
2494
2489
- auth_logger_logfile = None
2490
- if skip_log :
2491
- auth_logger_logfile = None
2492
- else :
2493
- auth_logger_logfile = self .user_auth_log
2495
+ if disable_auth_log :
2496
+ self .user_auth_log = None
2494
2497
2495
2498
if self .auth_logger_obj :
2496
2499
self .auth_logger_obj .reopen ()
2497
2500
else :
2498
2501
self .auth_logger_obj = Logger (
2499
- self .loglevel , logfile = auth_logger_logfile , app = 'main-auth' )
2502
+ self .loglevel , logfile = self . user_auth_log , app = 'main-auth' )
2500
2503
self .auth_logger = self .auth_logger_obj .logger
2501
2504
2502
2505
# cert and key for generating a default proxy for nordugrid/ARC
0 commit comments