Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default quiet=false when background with logfile #568

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

meatballhat
Copy link
Member

Closes #565

@meatballhat
Copy link
Member Author

@xeron How's this? 😸

@xeron
Copy link

xeron commented Jul 18, 2016

Well, it may help, but the whole situation raises some questions.

  • Why do you have different behavior in background/foreground mode?
  • Why do you have 2 variables controlling logging – VERBOSE and QUIET?
    • It's confusing
    • Seems like you don't respect VERBOSE in background mode? Or in both bg/fg modes?

I see this code in logger builder:

      def level
        if @verbose && !@quiet
          MonoLogger::DEBUG
        elsif !@quiet
          MonoLogger::INFO
        else
          MonoLogger::FATAL
        end
      end

but looks like in background mode you're using some different logic?

@meatballhat
Copy link
Member Author

@xeron I agree that the current situation with verbose and quiet is confusing. Legacy code! (and some recent changes)

My understanding of the current intent, is:

default_quiet = false

if options[:background]
  default_quiet = true
end

if options[:logfile]
  default_quiet = false
end

log_level = if options.fetch(:quiet, default_quiet)
              FATAL
            elsif options.fetch(:verbose, false)
              DEBUG
            else
              INFO
            end

I'm very much ready to believe that the current implementation does not match this intent. Supporting explicit log levels instead of the verbose / quiet thing sounds great to me, assuming that's what you're suggesting 😸

@xeron
Copy link

xeron commented Jul 19, 2016

Yeah, I think keeping only logfile and loglevel is better. But this is up to you. With explanation of what QUIET / VERBOSE actually do it's a bit cleaner for me now (if it works as you described).

@xeron
Copy link

xeron commented Feb 18, 2017

Soo, what happened to this PR and issue I reported? This bug still affects me :(

@bolsen
Copy link

bolsen commented Mar 1, 2017

I started using resque-scheduler and am noticing the same issue that @xeron is reporting here. Is there a workaround at least so we can get logs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants