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

feature: logger #2067

Merged
merged 2 commits into from
Dec 4, 2023
Merged

feature: logger #2067

merged 2 commits into from
Dec 4, 2023

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Nov 28, 2023

Description

Allow to specify custom logger by writing it on avo.rb initializer:

  ## == Logger ==
  config.logger = -> {
    file_logger = ActiveSupport::Logger.new(Rails.root.join("log", "avo.log"))
 
    file_logger.datetime_format = "%Y-%m-%d %H:%M:%S"
    file_logger.formatter = proc do |severity, time, progname, msg|
      "[Avo] #{time}: #{msg}\n".tap do |i|
        puts i
      end
    end
 
    file_logger
  }

Fixes https://github.com/avo-hq/avo-3/issues/457

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@Paul-Bob Paul-Bob self-assigned this Nov 28, 2023
Copy link

codeclimate bot commented Nov 28, 2023

Code Climate has analyzed commit bcda2db and detected 0 issues on this pull request.

View more on Code Climate.

@Paul-Bob Paul-Bob merged commit f6d29c1 into main Dec 4, 2023
14 checks passed
@Paul-Bob Paul-Bob deleted the feautre/logger branch December 4, 2023 14:28
Copy link
Contributor

github-actions bot commented Dec 4, 2023

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

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

2 participants