X-Git-Url: https://git.distorted.org.uk/~mdw/hippotat/blobdiff_plain/ff0fc3fa841805cb45013d4fdb3c0ca142b7a330..f022d67fe5078b10620651b5a0eddbd91d9b018b:/hippotatlib/__init__.py diff --git a/hippotatlib/__init__.py b/hippotatlib/__init__.py index 8a26bee..e8a502f 100644 --- a/hippotatlib/__init__.py +++ b/hippotatlib/__init__.py @@ -562,6 +562,11 @@ def common_startup(process_cfg): need_defcfg = False readconfig(value) + def read_defconfig(): + readconfig('/etc/hippotat/config.d', False) + readconfig('/etc/hippotat/passwords.d', False) + readconfig('/etc/hippotat/master.cfg', False) + def dfs_less_detailed(dl): return [df for df in DBG.iterconstants() if df <= dl] @@ -629,12 +634,11 @@ just `+': all DFLAGs. if len(args): optparser.error('no non-option arguments please') if need_defcfg: - readconfig('/etc/hippotat/config', False) - readconfig('/etc/hippotat/config.d', False) + read_defconfig() try: (pss, pcs) = _cfg_process_putatives() - process_cfg(pss, pcs) + process_cfg(opts, pss, pcs) except (configparser.Error, ValueError): traceback.print_exc(file=sys.stderr) print('\nInvalid configuration, giving up.', file=sys.stderr) @@ -650,15 +654,16 @@ just `+': all DFLAGs. stdsomething_obs = twisted.logger.FilteringLogObserver( stderr_obs, [pred], stdout_obs ) - log_observer = twisted.logger.FilteringLogObserver( + global file_log_observer + file_log_observer = twisted.logger.FilteringLogObserver( stdsomething_obs, [LogNotBoringTwisted()] ) #log_observer = stdsomething_obs twisted.logger.globalLogBeginner.beginLoggingTo( - [ log_observer, crash_on_critical ] + [ file_log_observer, crash_on_critical ] ) def common_run(): log_debug(DBG.INIT, 'entering reactor') if not _crashing: reactor.run() - print('CRASHED (end)', file=sys.stderr) + print('ENDED', file=sys.stderr)