From e8cb3d907c9916203e71a331907e66219c9b6723 Mon Sep 17 00:00:00 2001 From: Dogan Can Bakir <65292895+dogancanbakir@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:28:59 +0300 Subject: [PATCH] fix lib log config issue (#1200) Co-authored-by: Sandeep Singh --- v2/pkg/runner/options.go | 7 ++----- v2/pkg/runner/runner.go | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/v2/pkg/runner/options.go b/v2/pkg/runner/options.go index 582486503..195165856 100644 --- a/v2/pkg/runner/options.go +++ b/v2/pkg/runner/options.go @@ -165,16 +165,13 @@ func ParseOptions() *Options { // Check if stdin pipe was given options.Stdin = fileutil.HasStdin() - // Read the inputs and configure the logging - options.configureOutput() - if options.Version { gologger.Info().Msgf("Current Version: %s\n", version) gologger.Info().Msgf("Subfinder Config Directory: %s", configDir) os.Exit(0) } - options.preProcessOptions() + options.preProcessDomains() if !options.Silent { showBanner() @@ -235,7 +232,7 @@ func listSources(options *Options) { } } -func (options *Options) preProcessOptions() { +func (options *Options) preProcessDomains() { for i, domain := range options.Domain { options.Domain[i], _ = sanitize(domain) } diff --git a/v2/pkg/runner/runner.go b/v2/pkg/runner/runner.go index 83887ea94..d14dcb077 100644 --- a/v2/pkg/runner/runner.go +++ b/v2/pkg/runner/runner.go @@ -36,6 +36,7 @@ type Runner struct { // the configuration options, configuring sources, reading lists // and setting up loggers, etc. func NewRunner(options *Options) (*Runner, error) { + options.configureOutput() runner := &Runner{options: options} // Check if the application loading with any provider configuration, then take it