{"id":21237381,"url":"https://github.com/mateuszkubuszok/dbg","last_synced_at":"2025-06-22T00:03:35.931Z","repository":{"id":151700133,"uuid":"384590278","full_name":"MateuszKubuszok/dbg","owner":"MateuszKubuszok","description":"Debug typeclass for Scala 3","archived":false,"fork":false,"pushed_at":"2021-07-12T21:49:35.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T03:16:43.258Z","etag":null,"topics":["debugging","logging","scala","scala3","typeclass","typeclass-derivation"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MateuszKubuszok.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-07-10T02:05:49.000Z","updated_at":"2022-09-29T00:52:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"f747aa4d-3e2f-46cb-ad18-495280514ffa","html_url":"https://github.com/MateuszKubuszok/dbg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MateuszKubuszok/dbg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateuszKubuszok%2Fdbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateuszKubuszok%2Fdbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateuszKubuszok%2Fdbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateuszKubuszok%2Fdbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MateuszKubuszok","download_url":"https://codeload.github.com/MateuszKubuszok/dbg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateuszKubuszok%2Fdbg/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261212278,"owners_count":23125576,"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":["debugging","logging","scala","scala3","typeclass","typeclass-derivation"],"created_at":"2024-11-21T00:18:33.676Z","updated_at":"2025-06-22T00:03:30.917Z","avatar_url":"https://github.com/MateuszKubuszok.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Debug typeclass\n\nExperimental alternative to Cats' `Show` for Scala 3.\n\n## Why\n\n * no dependencies\n * derivation\n * indentation\n * long and short types names\n * allows to easily exclude some data from the output with an annotation\n * configurable output (result generated by visitor pattern)\n * `StringBuilder` instead of `String` concatenation\n\n## Usage\n\nDerivation:\n\n```scala\nimport dbg._\n\nfinal case class Inner(\n  s: String,\n  i: Int,\n  c: Char,\n  f: Float\n)\n\n@secure // hide whole case class content\nfinal case class InnerSecured(\n  s: String,\n  i: Int,\n  c: Char,\n  f: Float\n)\n\nenum Complex derives schema.Dbg: // use build-in derivation mechanics\n  case CaseObject\n  case CaseClass(\n    s:         String,\n    i:         Int,\n    c:         Char,\n    f:         Float,\n    @secure x: String, // hide only one field of a case class\n    inner:     Inner,\n    secure:    InnerSecured\n  )\n  @secure case Secured(p: String) // hide only one element of a sum type\n```\n\nCalling:\n\n```scala\nval example = List(\n  Complex.CaseObject,\n  Complex.CaseClass(\n    s = \"test\",\n    i = 10,\n    c = '+',\n    f = 1.0f,\n    x = \"password\",\n    inner = Inner(\n      s = \"test\",\n      i = 10,\n      c = '+',\n      f = 1.0f\n    ),\n    secure = InnerSecured(\n      s = \"test\",\n      i = 10,\n      c = '+',\n      f = 1.0f\n    )\n  ),\n  Complex.Secured(\n    p = \"password\"\n  )\n)\n```\n\n```scala\nimport dbg._\n\n// You can:\n// - use Default(isShort = true) to use one-letter package names instead of full names\n// - use Default(indent = yourIndent) to replace the default 2-spaces as a single indentation\n// - provide your own custom DbgRenderer if you want to handle differently collections, maps,\n//   products, sum types, etc\ngiven DbgRenderer = DbgRenderer.Default()\n\nprintln(debug\"render example: $example\")\n//render example: scala.collection.immutable.List(\n//  dbg.Tests.Complex case dbg.Tests.Complex.CaseObject,\n//  dbg.Tests.Complex case dbg.Tests.Complex.CaseClass(\n//    s = \"test\",\n//    i = 10,\n//    c = '+',\n//    f = 1.0f,\n//    x = java.lang.String[content redacted],\n//    inner = dbg.Tests.Inner(\n//      s = \"test\",\n//      i = 10,\n//      c = '+',\n//      f = 1.0f\n//    ),\n//    secure = dbg.Tests.InnerSecured[content redacted]\n//  ),\n//  dbg.Tests.Complex case dbg.Tests.Complex.Secured[content redacted]\n//)\n```\n\nMore examples of output can be checked in [tests](src/test/scala/dbg/DbgSpec.scala).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateuszkubuszok%2Fdbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateuszkubuszok%2Fdbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateuszkubuszok%2Fdbg/lists"}