{"id":18030479,"url":"https://github.com/stokito/go-logger-noalloc","last_synced_at":"2025-08-31T14:03:53.750Z","repository":{"id":57640601,"uuid":"433953500","full_name":"stokito/go-logger-noalloc","owner":"stokito","description":"Essential logger that avoids memory allocations","archived":false,"fork":false,"pushed_at":"2023-11-22T08:14:55.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-26T09:48:20.443Z","etag":null,"topics":["golang","logger","zero-alloc","zero-allocation"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stokito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-12-01T19:11:26.000Z","updated_at":"2024-07-08T21:06:26.000Z","dependencies_parsed_at":"2023-11-22T10:30:19.655Z","dependency_job_id":"ae31269a-8bdd-4912-8cc9-a150c85c69b8","html_url":"https://github.com/stokito/go-logger-noalloc","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/stokito/go-logger-noalloc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stokito%2Fgo-logger-noalloc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stokito%2Fgo-logger-noalloc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stokito%2Fgo-logger-noalloc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stokito%2Fgo-logger-noalloc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stokito","download_url":"https://codeload.github.com/stokito/go-logger-noalloc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stokito%2Fgo-logger-noalloc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988919,"owners_count":25026961,"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-08-31T02:00:09.071Z","response_time":79,"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":["golang","logger","zero-alloc","zero-allocation"],"created_at":"2024-10-30T09:14:22.671Z","updated_at":"2025-08-31T14:03:53.712Z","avatar_url":"https://github.com/stokito.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-logger-noalloc\nEssential logger that avoids memory allocation (zero alloc). Intended for a high performance systems.\nThat's why a stack trace is not printed and you must always put a method name or error code to find the place in source code.\nIt prints in syslog format so later it can be easily be processed by journald from systemd.\nFor example:\n```go\nolog.Printf(olog.INFO + \"Executing something\\n\")\n```\nSo info record will be printed as `\u003c6\u003eExecuting something` and the `\u003c6\u003e` here is a syslog prefix for INFO level.\n\n## Install\n\n    go get -u github.com/stokito/go-logger-noalloc\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"github.com/stokito/go-logger-noalloc\"\n\t\"os\"\n)\n\n// Log Prints everything to STDOUT but only if log level higher than INFO\nvar Log = \u0026olog.Logger{Out: os.Stdout, LogLevel: olog.LOG_INFO}\n\nfunc main() {\n\t// globally write to STDOUT\n\tolog.Printf(olog.DEBUG + \"Debug message to STDOUT\\n\")\n\n\t// Log level must be concatenated as a prefix. The \\n is required at end.\n\tLog.Printf(olog.DEBUG+\"Trace logging of vars like arg[0]: %s\\n\", os.Args[0])\n\t// Try to avoid unnecessary calculations if the DEBUG is anyway disabled\n\tif Log.IsLoggable(olog.LOG_DEBUG) {\n\t\t// some heavy calculations\n\t\tpwd, _ := os.Getwd()\n\t\tLog.Printf(\"Started in %s\\n\", pwd)\n\t\tLog.Printf(olog.DEBUG+\"Started in %s\\n\", pwd)\n\t}\n\tLog.Printf(olog.INFO + \"Describe execution step or the app sends/received a request from external system, minor error occurred like a timeout\\n\")\n\tLog.Printf(olog.WARN + \"Something suspicious happened, used deprecated API or an error occurred because a request is invalid\\n\")\n\tLog.Printf(olog.NOTICE + \"Application did something important: processed a request, finished processing\\n\")\n\tLog.Printf(olog.ERR + \"Unexpected internal error occurred: invalid request format\\n\")\n\tLog.Printf(olog.CRIT + \"App can't do something: a port is already taken, missing config etc, fatal panic\\n\")\n\t// you can't log EMERG: leave it for OS\n\t// Now try to disable logs...\n\tLog.LogLevel = olog.LOG_EMERG\n\tLog.Printf(olog.ERR + \"...and any error will be anyway printed\\n\")\n\tLog.Printf(olog.INFO + \"But INFO now won't be printed\\n\")\n}\n```\n\nSee [example](examples/log_example.go)\n\n## License\n[0BSD](https://opensource.org/licenses/0BSD) (similar to Public Domain)\n\n## See also\n* [logrus-systemd-formatter](https://github.com/quillaja/logrus-systemd-formatter)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstokito%2Fgo-logger-noalloc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstokito%2Fgo-logger-noalloc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstokito%2Fgo-logger-noalloc/lists"}