{"id":18832746,"url":"https://github.com/brandymint/auto_logger","last_synced_at":"2025-07-08T21:33:07.840Z","repository":{"id":53593647,"uuid":"147231562","full_name":"BrandyMint/auto_logger","owner":"BrandyMint","description":"Mixin to use automatically configured `logger`","archived":false,"fork":false,"pushed_at":"2023-01-21T02:31:35.000Z","size":23,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-02T11:14:30.031Z","etag":null,"topics":["autologger","gem","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrandyMint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-03T16:52:52.000Z","updated_at":"2021-12-23T23:51:45.000Z","dependencies_parsed_at":"2023-02-12T07:30:26.260Z","dependency_job_id":null,"html_url":"https://github.com/BrandyMint/auto_logger","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/BrandyMint/auto_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Fauto_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Fauto_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Fauto_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Fauto_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrandyMint","download_url":"https://codeload.github.com/BrandyMint/auto_logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrandyMint%2Fauto_logger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264352996,"owners_count":23595014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autologger","gem","ruby","ruby-gem"],"created_at":"2024-11-08T01:58:53.293Z","updated_at":"2025-07-08T21:33:07.822Z","avatar_url":"https://github.com/BrandyMint.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoLogger\n\n[![Build Status](https://travis-ci.org/BrandyMint/auto_logger.svg)](https://travis-ci.org/BrandyMint/auto_logger)\n\nУпрощяет подключение уникальных логгеров для модулей и классов. После\nподключения в модуль или класс через `include AutoLogger` добавляет метод\n`logger` который пишет логи в файл автоматически сформированные из измени\nмодуля/класса в каталог `./log`\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'auto_logger'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install auto_logger\n\n## Usage\n\n### Instance usage\n\n```\nclass SomeService\n  include AutoLogger\n\n  def perform\n    logger.info 'some' # writes info into ./logs/some_service.log\n  end\nend\n```\n\n\n### Grape example\n\nИногда необходимо насильно указать имя файла для лога. Например при подключении\nв модули/класс без имени, в частности в grape-контролерах:\n\n```\nclass PublicAPI::OrdersAPI \u003c Grape::API\n  helpers do\n    include AutoLogger::Named.new(name: :orders_api)\n  end\nend\n```\n\n## Usage in module context\n\n```\nmodule Custom\n  extend AutoLogger\n\n  def self.perform\n     logger.info \"Do...\"\n  end\nend\n\nCustom.logger.info \"Do..\"\n```\n\n## Setup custom logger\n\n```\nAutoLogger.logger_builder = -\u003e (tag, default_formatter) {\n  ActiveSupport::TaggedLogging\n    .new(LogStashLogger.new(type: :stdout))\n    .tagged(tag)\n}\n```\n\n## Collapse all logs to one (useful for development)\n\n```\nif ENV['COLLAPSE_AUTO_LOGGER'].present?\n  if ENV['COLLAPSE_AUTO_LOGGER'] == 'STDOUT'\n    logger = Logger.new(STDOUT)\n  else\n    logger = Rails.logger\n  end\n  AutoLogger.logger_builder = -\u003e (tag, default_formatter) {\n    ActiveSupport::TaggedLogging\n      .new(logger)\n      .tagged(tag)\n  }\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/dapi/auto_logger. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the AutoLogger project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/dapi/auto_logger/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandymint%2Fauto_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrandymint%2Fauto_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrandymint%2Fauto_logger/lists"}