{"id":15591272,"url":"https://github.com/coderberry/debug_logger","last_synced_at":"2026-06-12T21:31:31.428Z","repository":{"id":66467338,"uuid":"531274627","full_name":"coderberry/debug_logger","owner":"coderberry","description":"When puts isn't enough","archived":false,"fork":false,"pushed_at":"2022-09-01T15:32:10.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T04:14:07.205Z","etag":null,"topics":[],"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/coderberry.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-31T22:08:06.000Z","updated_at":"2022-09-01T20:41:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"5834b182-55dd-437f-b0a1-0e7e7fa79e54","html_url":"https://github.com/coderberry/debug_logger","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/coderberry/debug_logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fdebug_logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fdebug_logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fdebug_logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fdebug_logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderberry","download_url":"https://codeload.github.com/coderberry/debug_logger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderberry%2Fdebug_logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34263869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-02T23:40:47.478Z","updated_at":"2026-06-12T21:31:31.405Z","avatar_url":"https://github.com/coderberry.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DebugLogger\n\nWhen `puts` isn't enough.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add debug-logger\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install debug-logger\n\n## Usage\n\nSimply add the gem to your Gemfile and run `bundle install`. If you are using Rails, add the following initializer:\n\n```ruby\n# config/initializers/debug_logger.rb\nrequire \"debug_logger\"\n\nDebugLogger.configure do |config|\n  config.default_title = 'DEBUG'\n  config.log_file = 'log/debug.log' # or \"log/#{Rails.env}.log\"\n  config.line_char = '*'\nend\n```\n\n- `default_title` is the default title for the log messages. It can be overridden by passing a title to the `log` method.\n- `log_file` is the path to the log file. It can be overridden by passing a file path to the `log` method.\n- `line_char` is the character used to draw the line around the log message.\n\nThen, you can use the `log` method to log messages to the log file:\n\n```ruby\nDebugLogger.log(message: \"This is a test\")\n```\n\n### Example Usage\n\n##### Simple Log\n\n```ruby\nDebugLogger.log(message: \"This is a test\")\n```\n\nadds the following to your logs:\n\n```\n2022-09-01 08:42:29.029488 I [12319:2720] DebugLogger -- ************************************ DEBUG ************************************\n2022-09-01 08:42:29.029503 I [12319:2720] DebugLogger -- test\n2022-09-01 08:42:29.029508 I [12319:2720] DebugLogger -- *******************************************************************************\n```\n\n##### Log with Title\n\n```ruby\nDebugLogger.log(message: \"This is a test\", title: \"TEST\")\n```\n\nadds the following to your logs:\n\n```\n2022-09-01 08:42:29.029488 I [12319:2720] DebugLogger -- ************************************ TEST *************************************\n2022-09-01 08:42:29.029503 I [12319:2720] DebugLogger -- This is a test\n2022-09-01 08:42:29.029508 I [12319:2720] DebugLogger -- *******************************************************************************\n```\n\n##### Log with Title and File\n\n```ruby\nDebugLogger.log(message: \"This is logging to log/debug.log\", title: \"FILE TEST\", file: \"log/debug.log\")\n```\n\nadds the following to _log/debug.log_:\n\n```\n2022-09-01 08:42:29.029488 I [12319:2720] DebugLogger -- ************************************ TEST *************************************\n2022-09-01 08:42:29.029503 I [12319:2720] DebugLogger -- This is logging to log/debug.log\n2022-09-01 08:42:29.029508 I [12319:2720] DebugLogger -- *******************************************************************************\n```\n\n##### Log with line_char of `~`\n\n```ruby\nDebugLogger.log(message: \"This is a test\", title: \"TEST\", line_char: \"~\")\n```\n\nadds the following to your logs:\n\n```\n2022-09-01 08:42:29.029488 I [12319:2720] DebugLogger -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n2022-09-01 08:42:29.029503 I [12319:2720] DebugLogger -- This is a test\n2022-09-01 08:42:29.029508 I [12319:2720] DebugLogger -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n```\n\n##### Log with block\n\n```ruby\nDebugLogger.log(title: 'DEBUG') { \u003c\u003c~DEBUG }\n  Time: #{Time.new}\n  Sum: #{1 + 2}\nDEBUG\n```\n\nadds the following to your logs:\n\n```\n2022-09-01 08:42:29.029488 I [12319:2720] DebugLogger -- ************************************ DEBUG ************************************\n2022-09-01 08:42:29.029503 I [12319:2720] DebugLogger -- Time: 2022-09-01 08:42:29 -0400\n2022-09-01 08:42:29.029508 I [12319:2720] DebugLogger -- Sum: 3\n2022-09-01 08:42:29.029508 I [12319:2720] DebugLogger -- *******************************************************************************\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to run the specs. 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 the created tag, 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/coderberry/debug_logger. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/coderberry/debug_logger/blob/main/CODE_OF_CONDUCT.md).\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 DebugLogger project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/coderberry/debug_logger/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Fdebug_logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderberry%2Fdebug_logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderberry%2Fdebug_logger/lists"}