{"id":17679298,"url":"https://github.com/bbkane/logos","last_synced_at":"2025-10-28T11:31:21.380Z","repository":{"id":57596712,"uuid":"375216555","full_name":"bbkane/logos","owner":"bbkane","description":"Logging + Printing + Compromising","archived":false,"fork":false,"pushed_at":"2025-07-17T14:29:28.000Z","size":1074,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-14T18:12:54.677Z","etag":null,"topics":["go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/bbkane.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":"2021-06-09T03:39:22.000Z","updated_at":"2025-07-17T14:29:32.000Z","dependencies_parsed_at":"2024-10-24T10:47:10.773Z","dependency_job_id":"24d57b92-14f4-4f44-96c5-5fab3380ca29","html_url":"https://github.com/bbkane/logos","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/bbkane/logos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flogos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flogos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flogos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flogos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbkane","download_url":"https://codeload.github.com/bbkane/logos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbkane%2Flogos/sbom","scorecard":{"id":227969,"data":{"date":"2025-08-11","repo":{"name":"github.com/bbkane/logos","commit":"1f6849c903223f4e1836c713bf2f99fadb8bed5b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/ci.yml:34","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/bbkane/logos/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/bbkane/logos/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/bbkane/logos/ci.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:24","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 13 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T04:11:32.456Z","repository_id":57596712,"created_at":"2025-08-17T04:11:32.457Z","updated_at":"2025-08-17T04:11:32.457Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280733989,"owners_count":26381845,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"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":["go"],"created_at":"2024-10-24T08:22:00.963Z","updated_at":"2025-10-28T11:31:21.374Z","avatar_url":"https://github.com/bbkane.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logos\n\n***Logging + Printing + Compromising***\n\nlogos is a small and super-opinionated wrapper around [`go.uber.org/zap`](https://pkg.go.dev/go.uber.org/zap?utm_source=godoc) to:\n\n- give users decent looking output\n- give auditors structured logs to analyze\n- give developers an easy way to print and log with the same function call\n\n![demo](./demo/demo.gif)\n\n## Project Status (2025-06-14)\n\nI use `logos` in `grabbit`, but I've switched to `log/slog` and OTEL traces elsewhere, and I intend to switch away from `logos` in `grabbit` as well. I think I can get a similar beautiful console output with OTEL traces as well as better offline visualization. At that point I'll archive `logos`.\n\n## Usage\n\nA call to a `logos.Logger` looks like:\n\n```go\nlogger.Infow(\n    \"Now we're logging :)\",\n    \"key\", \"value\",\n    \"otherkey\", \"othervalue\",\n)\n```\n\nThis produces a `stdout` output of:\n\n```\nINFO: Now we're logging :)\n  key: \"value\"\n  otherkey: \"othervalue\"\n```\n\nAssuming `NewZapSugaredLogger` is used to create the logger,\nthis `logger.Infow` call produces this log line:\n\n```json\n{\"_level\":\"INFO\",\"_timestamp\":\"2021-06-08T22:16:29.161-0700\",\"_caller\":\"logos/example_logos_test.go:21\",\"_function\":\"github.com/bbkane/logos_test.Example\",\"_msg\":\"Now we're logging :)\",\"_pid\":49721,\"_version\":\"v1.0.0\",\"key\":\"value\",\"otherkey\":\"othervalue\"}\n```\n\nNote that logos can wrap any `zap.Logger`, the provided `NewZapSugaredLogger` is only a convenience function.\n\nSee the [pkg.go.dev docs](https://pkg.go.dev/github.com/bbkane/logos) for the exact API and example usage.\n\n## When to use\n\nlogos *might* be useful for small CLI apps that need logs\n\nlogos *won't* be useful for performance sensitive apps (no attention paid to allocation, unbuffered prints), apps designed to produce output for piping to another command, or apps producing deeply nested logs.\n\nlogos is imported by [these open-source packages](https://pkg.go.dev/github.com/bbkane/logos?tab=importedby).\n\n## Philosophy\n\n`logos` users (i.e., the author 😃)  believe only 3 log levels are needed:\n\n- `DEBUG` for information only needed by auditors looking at the logs\n- `ERROR` for problems\n- `INFO` for other information\n\nCorrespondingly, logos offers the following functions and destinations for their content:\n\n|                 | stderr | stdout | logfile |\n| --------------- | :----: | :----: | :-----: |\n| `Logger.Debugw` |        |        |    x    |\n| `Logger.Errorw` |   x    |        |    x    |\n| `Logger.Infow`  |        |   x    |    x    |\n\nThe logger methods are a subset of `zap.SugaredLogger`.\n\nIn addition, logos offers `Logger.Sync` to sync the logs and `Logger.LogOnPanic` as an optional function to `recover` from a panic, log, and then panic again.\n\n## Analyzing JSON Logs\n\nThe great thing about structured JSON logs is you can use powerful tools to analyze them. Let's analyze the logs for my local installation of [`grabbit`](https://github.com/bbkane/grabbit). `grabbit` stores its logs in `~/.config/grabbit.jsonl`\n\n### Analyze as JSON\n\nSelect the last error using [`jq`](https://stedolan.github.io/jq/):\n\n```bash\njq -s 'map(select(._level == \"ERROR\")) | reverse | limit(1;.[])' ~/.config/grabbit.jsonl\n```\n\n```json\n{\n  \"_level\": \"ERROR\",\n  \"_timestamp\": \"2021-06-07T12:51:23.023-0700\",\n  \"_caller\": \"grabbit/main.go:277\",\n  \"_function\": \"main.grab\",\n  \"_msg\": \"can't download image\",\n  \"_pid\": 33557,\n  \"_version\": \"4.0.6\",\n  \"subreddit\": \"wallpapers\",\n  \"post\": \"Your Name ( Kimi No Na Wa ) Screens [1080P upscaled to 4K]\",\n  \"url\": \"https://www.reddit.com/gallery/nqwe27\",\n  \"err\": \"urlFileName doesn't end in allowed extension: \\\"nqwe27\\\" , []string{\\\".jpg\\\", \\\".jpeg\\\", \\\".png\\\"}\\n \",\n  \"errVerbose\": \"urlFileName doesn't end in allowed extension: \\\"nqwe27\\\" , []string{\\\".jpg\\\", \\\".jpeg\\\", \\\".png\\\"}\\n \\nmain.validateImageURL\\n\\t/home/runner/work/grabbit/grabbit/main.go:198\\nmain.grab\\n\\t/home/runner/work/grabbit/grabbit/main.go:275\\nmain.run\\n\\t/home/runner/work/grabbit/grabbit/main.go:416\\nmain.main\\n\\t/home/runner/work/grabbit/grabbit/main.go:429\\nruntime.main\\n\\t/opt/hostedtoolcache/go/1.16.2/x64/src/runtime/proc.go:225\\nruntime.goexit\\n\\t/opt/hostedtoolcache/go/1.16.2/x64/src/runtime/asm_amd64.s:1371\"\n}\n```\n\nOther tools  (most of which I haven't tried) to analyze  JSON  include [`ax`](https://github.com/egnyte/ax), [`fblog`](https://github.com/brocode/fblog), [`jiq`](https://github.com/fiatjaf/jiq), [`jsonui`](https://github.com/gulyasm/jsonui)  , [`jql`](https://github.com/cube2222/jql), and [`jid`](https://github.com/simeji/jid).\n\n### Analyze as CSV\n\nI wrote a small Python script I call [jsonl_to.py](https://github.com/bbkane/dotfiles/blob/master/bin_common/bin_common/jsonl_to.py) to convert line-delimited JSON (`.jsonl`) to CSV for analysis in Google Sheets or similar programs. Here's my grabbit log for perusal [in Google Sheets](https://docs.google.com/spreadsheets/d/1FUA8kWBhkAr1eyaZZ0selVuVv-J6nilovCQz9HEUDkk/edit?usp=sharing).\n\nThat CSV was generated with:\n\n```bash\njsonl_to.py -f csv ~/.config/grabbit.jsonl \u003e ~/tmp.csv\n```\n\n### Analyze as SQLite3\n\nOf course, SQLite3 can also [import CSVs](https://unix.stackexchange.com/a/638984/185953), and then it's possible to analyze logs with any SQLite3 tool. SQLite3 tools I like are the SQLite3 shell, [litecli](https://github.com/dbcli/litecli), [Beekeeper Studio](https://www.beekeeperstudio.io/), and [DbGate](https://dbgate.org/).\n\n```bash\njsonl_to.py -f csv ~/.config/grabbit.jsonl \\\n| sqlite3 ~/tmpgrabbitlogs.db '.import --csv /dev/stdin logs'\n```\n\n![Beekeeper Studio Results](./beekeeper_studio_results.png)\n\n## History\n\nlogos began as a set of functions in [`grabbit`](https://github.com/bbkane/grabbit), so I could have a log of failed image downloads to analyze. Eventually I extracted it into [`sugarkane`](https://github.com/bbkane/sugarkane) to use in other apps. Finally, I reworked the API and released logos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbkane%2Flogos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbkane%2Flogos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbkane%2Flogos/lists"}