{"id":25065474,"url":"https://github.com/tagbase-io/logger-binary","last_synced_at":"2026-02-09T08:02:49.560Z","repository":{"id":274487875,"uuid":"923074046","full_name":"tagbase-io/logger-binary","owner":"tagbase-io","description":"A custom Logger formatter for handling binary data.","archived":false,"fork":false,"pushed_at":"2025-02-02T08:01:29.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-11T02:20:16.540Z","etag":null,"topics":["binary","elixir","elixir-logger","logger"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/tagbase-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2025-01-27T15:48:03.000Z","updated_at":"2025-02-02T08:01:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f4ab7ef-b298-40fa-b1c0-3b6977d80308","html_url":"https://github.com/tagbase-io/logger-binary","commit_stats":null,"previous_names":["tagbase-io/logger-binary"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tagbase-io/logger-binary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagbase-io%2Flogger-binary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagbase-io%2Flogger-binary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagbase-io%2Flogger-binary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagbase-io%2Flogger-binary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tagbase-io","download_url":"https://codeload.github.com/tagbase-io/logger-binary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tagbase-io%2Flogger-binary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29259466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T04:11:57.159Z","status":"ssl_error","status_checked_at":"2026-02-09T04:11:56.117Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binary","elixir","elixir-logger","logger"],"created_at":"2025-02-06T19:27:19.917Z","updated_at":"2026-02-09T08:02:49.555Z","avatar_url":"https://github.com/tagbase-io.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoggerBinary [![CI](https://github.com/tagbase-io/logger-binary/actions/workflows/test.yml/badge.svg)](https://github.com/tagbase-io/logger-binary/actions/workflows/test.yml)\n\nA custom `Logger` formatter for handling binary data.\n\nThis formatter is designed to correctly format binary messages. It converts\nnon-printable binary data into a hexadecimal string representation and can\noptionally add a directional indicator (`\"\u003c \"` or `\"\u003e \"`) when needed.\n\n## Usage\n\n```elixir\ndef deps do\n  [\n    {:logger_binary, \"~\u003e 0.2.0\"}\n  ]\nend\n```\n\n```elixir\nconfig :logger, LoggerBinary.Formatter, format: \"[$level] $message\\n\"\n\nconfig :logger, :console,\n  format: {LoggerBinary.Formatter, :format},\n  metadata: [:direction]\n```\n\n## Features\n\n* Formats binary data as uppercase hexadecimal strings via `LoggerBinary.format/1`.\n* Prepends formatted binary messages with a directional indicator if the `:direction`\n  metadata is present. Supported values for the `:direction` metadata are `:in` and `:out`.\n* Uses the default Logger format for all other types of messages (e.g., printable strings and charlists).\n\n## Direction Indicator\n\nYou can add the `:direction` metadata to your log messages to indicate if the\nbinary data is an incoming or outgoing message:\n\n```elixir\nLogger.debug(\u003c\u003c0x01, 0x02, 0x03\u003e\u003e, direction: :in)\n# Logs: \"[debug] \u003c 01 02 03\"\n\nLogger.debug(\u003c\u003c0x01, 0x02, 0x03\u003e\u003e, direction: :out)\n# Logs: \"[debug] \u003e 01 02 03\"\n```\n\nWithout directional metadata, it simply logs the formatted binary:\n\n```elixir\nLogger.debug(\u003c\u003c0x01, 0x02, 0x03\u003e\u003e)\n# Logs: \"[debug] 01 02 03\"\n```\n\n## Direct Formatting\n\nYou can also format binary data directly without logging:\n\n```elixir\nLoggerBinary.format(\u003c\u003c0xDE, 0xAD, 0xBE, 0xEF\u003e\u003e)\n# Returns: \"DE AD BE EF\"\n\nLoggerBinary.format(:timeout)\n# Returns: \":timeout\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftagbase-io%2Flogger-binary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftagbase-io%2Flogger-binary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftagbase-io%2Flogger-binary/lists"}