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

Parsing of datetime produces debug log as warning #395

Closed
PascalTurbo opened this issue Dec 11, 2017 · 4 comments · Fixed by #492
Closed

Parsing of datetime produces debug log as warning #395

PascalTurbo opened this issue Dec 11, 2017 · 4 comments · Fixed by #492

Comments

@PascalTurbo
Copy link

When parsing a datetime that isn't supported and logger is set to log level "WARN" the debug output aka backtrace is logged with severity WARN instead of DEBUG.

@mikeastock
Copy link
Member

This has been released in https://github.com/feedjira/feedjira/releases/tag/v2.1.3

@Ben-Fenner
Copy link

Seems there was a regression and in version 3.1.1 at least, this poor behavior has returned. :(

mockdeep added a commit that referenced this issue Feb 23, 2024
Fix #395 (again). There are a couple of places we log out failures to
parse dates. This updates the *other* one to be `debug` log level.
mockdeep added a commit that referenced this issue Feb 23, 2024
Fix #395 (again). There are a couple of places we log out failures to
parse dates. This updates the *other* one to be `debug` log level.
@mockdeep
Copy link
Member

@Ben-Fenner can you give version 3.2.3 a try?

@Ben-Fenner
Copy link

Ben-Fenner commented Feb 26, 2024

Sorry, version 3.1.1 is the latest I can manage right now, but I did confirm the code causing the regression was still in place when I made my post. Sorry, I should have linked to it.

I went to go find it to give you a link to the code just now, but it looks like it's been fixed. And looking at the file history, it seems you did so yourself about 3 days ago. 👍 336b658

I see now you're hoping I can test that out. Sorry I can't test because I'm on Ruby 2.3.8 but for what it's worth it looks like your commit should do the trick. Thank you for the work. I wistfully hope one day soonish we'll be on a newer Ruby version.

For those who find this issue in the future and need a work-around like I did. We added a Rails initializer that changes the log level to ERROR.

config/initializers/feedjira.rb

# Feedjira's logging for datetime parse issues is set to WARN, and so is the resulting backtrace output, when both (or
# at least the backtrace) should be set to DEBUG. This was a problem in `2.1.2` and was fixed in `2.1.3` but returned as
# a regression some time later and the version we're on now (`3.1.1`) is misbehaving again. So we set the log level here
# abnormally high to avoid that situation.
#
# Refs:
#  https://github.com/feedjira/feedjira/issues/397
#  https://github.com/feedjira/feedjira/issues/395
#  https://github.com/feedjira/feedjira/blob/v3.1.1/lib/feedjira/configuration.rb
#  https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
#
# TODO: It looks like version 3.2.3 has the fix for this, so upgrade when possible.
Feedjira.configure do |config|
  config.logger.level = Logger::ERROR
end

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

Successfully merging a pull request may close this issue.

4 participants