{"id":26470121,"url":"https://github.com/busimus/gocutelog","last_synced_at":"2025-03-19T17:19:15.185Z","repository":{"id":57564223,"uuid":"142584304","full_name":"busimus/gocutelog","owner":"busimus","description":"Bridge between Go logging libraries and cutelog","archived":false,"fork":false,"pushed_at":"2018-08-02T07:53:31.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T06:37:43.637Z","etag":null,"topics":["go","gui","logging"],"latest_commit_sha":null,"homepage":null,"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/busimus.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}},"created_at":"2018-07-27T14:01:58.000Z","updated_at":"2018-08-02T07:53:29.000Z","dependencies_parsed_at":"2022-09-11T04:51:20.528Z","dependency_job_id":null,"html_url":"https://github.com/busimus/gocutelog","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busimus%2Fgocutelog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busimus%2Fgocutelog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busimus%2Fgocutelog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/busimus%2Fgocutelog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/busimus","download_url":"https://codeload.github.com/busimus/gocutelog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244470286,"owners_count":20457911,"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":["go","gui","logging"],"created_at":"2025-03-19T17:19:14.681Z","updated_at":"2025-03-19T17:19:15.161Z","avatar_url":"https://github.com/busimus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gocutelog – bridge between Go logging libraries and cutelog\n[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/busimus/gocutelog) [![license](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://raw.githubusercontent.com/busimus/gocutelog/master/LICENSE)\n\nThis Go package makes it possible to send log records from Go logging libraries\nto a [cutelog](https://github.com/busimus/cutelog) instance without having to\nmanually manage a socket connection.\n\nFunction [NewWriter](https://godoc.org/github.com/busimus/gocutelog#NewWriter) \nreturns a struct that implements io.Writer interface so it can be used as \noutput by libraries like zerolog, zap, onelog, logrus, etc.\n\nJust like cutelog itself, this package is meant to be used only during\ndevelopment, so performance or reliability are not the focus here.\n\n## Usage\n### zerolog\n```go\npackage main\n\nimport (\n    \"github.com/busimus/gocutelog\"\n    \"github.com/rs/zerolog\"\n)\n\nfunc main() {\n\tw := gocutelog.NewWriter(\"localhost:19996\", \"json\")\n\tl := zerolog.New(w)\n\tl.Info().Msg(\"Hello world from zerolog!\")\n}\n```\n\n### onelog\n```go\npackage main\n\nimport (\n    \"github.com/busimus/gocutelog\"\n    \"github.com/francoispqt/onelog\"\n)\n\nfunc main() {\n\tw := gocutelog.NewWriter(\"localhost:19996\", \"json\")\n\tl := onelog.New(w, onelog.ALL)\n\tl.Info(\"Hello world from onelog!\")\n}\n```\n\n### logrus\n```go\npackage main\n\nimport (\n    \"github.com/busimus/gocutelog\"\n    \"github.com/sirupsen/logrus\"\n)\n\nfunc main() {\n\tw := gocutelog.NewWriter(\"localhost:19996\", \"json\")\n\tl := logrus.New()\n\tl.Out = w\n\tl.Formatter = new(logrus.JSONFormatter)\n\tl.Info(\"Hello world from logrus!\")\n}\n```\n\n### zap\n```go\npackage main\n\nimport (\n    \"github.com/busimus/gocutelog\"\n\t\"go.uber.org/zap\"\n   \t\"go.uber.org/zap/zapcore\"\n)\n\nfunc main() {\n\tw := gocutelog.NewWriter(\"localhost:19996\", \"json\")\n\tconf := zapcore.EncoderConfig{\n\t\tTimeKey:        \"time\",\n\t\tLevelKey:       \"level\",\n\t\tNameKey:        \"name\",\n\t\tCallerKey:      \"caller\",\n\t\tMessageKey:     \"msg\",\n\t\tStacktraceKey:  \"exc_info\",\n\t\tLineEnding:     \"\",\n\t\tEncodeLevel:    zapcore.CapitalLevelEncoder,\n\t\tEncodeTime:     zapcore.EpochTimeEncoder,\n\t\tEncodeDuration: zapcore.SecondsDurationEncoder,\n\t\tEncodeCaller:   zapcore.ShortCallerEncoder,\n\t}\n\tenc := zapcore.NewJSONEncoder(conf)\n\tpriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool {\n\t\treturn true\n\t})\n\tcore := zapcore.NewCore(enc, w, priority)\n\tl := zap.New(core)\n\tl.Info(\"Hello world from zap!\")\n}\n```\n\n## License\nReleased under the [MIT license](https://raw.githubusercontent.com/busimus/gocutelog/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusimus%2Fgocutelog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusimus%2Fgocutelog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusimus%2Fgocutelog/lists"}